api.cgi 707 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/usr/local/cpanel/3rdparty/bin/perl
  2. #ACLS:all
  3. package Troglodyne::CGI::API;
  4. use strict;
  5. use warnings;
  6. use Cpanel::LoadModule::Custom ();
  7. use JSON::XS ();
  8. run() unless caller();
  9. sub run {
  10. # Load up CGI processing modules
  11. Cpanel::LoadModule::Custom::load_perl_module("Troglodyne::CGI");
  12. # Process the args
  13. my $args = Troglodyne::CGI::get_args();
  14. # Get back the datastruct from the called module.
  15. my $ret = {
  16. 'metadata' => {
  17. 'input_args' => $args,
  18. },
  19. 'data' => {},
  20. 'result' => 1,
  21. };
  22. # Emit the JSON
  23. print "Content-type: application/json\r\n\r\n";
  24. print JSON::XS::encode_json($ret);
  25. exit;
  26. }
  27. 1;