Commit 0e4fffaf authored by Xavier Guimard's avatar Xavier Guimard

Full Plack example (#1397)

parent 9cb44cc6
#!/usr/bin/perl
use Data::Dumper;
use Plack::Builder;
# Test
my $testApp = sub {
my ($env) = @_;
return [
200,
[ 'Content-Type' => 'text/plain' ],
[ "Hello world\n\n" . Dumper($env) ],
];
};
my $test = builder {
enable "Auth::LemonldapNG";
$testApp;
};
use Lemonldap::NG::Portal::Main;
my $portal = builder {
enable "Plack::Middleware::Static",
path => '^/static/',
root => '/home/xavier/dev/lemonldap/lemonldap-ng-portal/site/htdocs/';
Lemonldap::NG::Portal::Main->run( {} );
};
use Lemonldap::NG::Manager;
my $manager = builder {
enable "Plack::Middleware::Static",
path => '^/static/',
root => '/home/xavier/dev/lemonldap/lemonldap-ng-manager/site/htdocs/';
enable "Plack::Middleware::Static",
path => '^/doc/',
root => '/home/xavier/dev/lemonldap/';
enable "Plack::Middleware::Static",
path => '^/lib/',
root => '/home/xavier/dev/lemonldap/doc/pages/documentation/current/';
enable "Plack::Middleware::Static",
path => '^/fr-doc/',
root => '/home/xavier/dev/lemonldap/po-doc/';
Lemonldap::NG::Manager->run( {} );
};
builder {
mount 'http://test1.example.com/' => $test;
mount 'http://auth.example.com/' => $portal;
mount 'http://manager.example.com/' => $manager;
};
fr
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment