Handler PSGI server skeleton (for nginx)

environments/ppa-mbqj77/deployments/1
Xavier Guimard 9 years ago
parent 2568201eca
commit f2ca23f30c
  1. 5
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/API/PSGI.pm
  2. 12
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/API/PSGI/Server.pm
  3. 19
      lemonldap-ng-handler/lib/Lemonldap/NG/Handler/PSGI/Server.pm

@ -1,6 +1,7 @@
package Lemonldap::NG::Handler::API::PSGI;
our $VERSION = '1.4.0';
use strict;
our $VERSION = '1.9.0';
# Specific modules and constants for Test or CGI
use constant FORBIDDEN => 403;
@ -12,7 +13,7 @@ use constant SERVER_ERROR => 500;
use constant AUTH_REQUIRED => 401;
use constant MAINTENANCE => 503;
my $request;
our $request;
## @method void thread_share(string $variable)
# share or not the variable (if authorized by specific module)

@ -0,0 +1,12 @@
package Lemonldap::NG::Handler::API::PSGI::Server;
use strict;
our $VERSION = '1.9.0';
use base Lemonldap::NG::Handler::API::PSGI;
sub uri {
return $Lemonldap::NG::Handler::API::PSGI::$request->original_uri;
}
1;

@ -0,0 +1,19 @@
package Lemonldap::NG::Handler::PSGI::Server;
use strict;
use Mouse;
extends 'Lemonldap::NG::Handler::PSGI';
sub router {
return [ 200, [], [] ];
}
sub _run {
my $self = shift;
my $res = $self->SUPER::_run(@_);
# TODO: insert headers
return $res;
}
1;
Loading…
Cancel
Save