Sub::Spec::HTTP::Server

Serve subroutine calls via HTTP/HTTPS
Download

Sub::Spec::HTTP::Server Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Steven Haryanto
  • Publisher web site:
  • http://search.cpan.org/~sharyanto/

Sub::Spec::HTTP::Server Tags


Sub::Spec::HTTP::Server Description

Serve subroutine calls via HTTP/HTTPS Sub::Spec::HTTP::Server is a preforking HTTP (TCP and Unix socket)/HTTPS (TCP) daemon for serving function call requests (usually for API calls). All functions should have Sub::Spec specs.This module uses Log::Any for logging.This module uses Moo for object system.SYNOPSISIn your program: use Sub::Spec::HTTP::Server; use My::Module1; use My::Module2; my $server = Sub::Spec::HTTP::Server->new( sock_path => '/var/run/apid.sock', # activate listening to Unix socket #http_port => 949, # default is 80 #https_port => 1234, # activate https #ssl_key_file => '/path/to/key.pem', # need this for https #ssl_cert_file => '/path/to/crt.pem', # need this for https #max_requests_per_child => 100, # default is 1000 #start_servers => 0, # default is 3, 0 means don't prefork #daemonize => 0, # do not go to background ); $server->run;After running the program, accessing: http://localhost:949/My/Module2/func?arg1=1&arg2=2You will be getting a JSON response: Requirements: · Perl


Sub::Spec::HTTP::Server Related Software