PSGI is an interface between Perl web applications and web servers, and Plack is a Perl module and toolkit that contains PSGI middleware, helpers and adapters to web servers. http://plackperl.org
Crust is a set of tools for using the PSGI stack. It contains middleware components(TBI), and utilities for Web application frameworks. Crust is like Perl5's Plack, Ruby's Rack, Python's Paste for WSGI. https://github.com/tokuhirom/p6-Crust
get '/user/:name' do "You're #{params['name']}!" end get '/' => sub { my ( $self, $c ) = @_; $c->render('index.tx', { msg => "Hello!" }); }; Sinatra Kossy
my class RoutingStaff { has Callable $.app; }; sub router($methods, $path, $app) is export { $ROUTER.add( @$methods, $path, RoutingStaff.new(:$app) ); } sub get($path, $app) is export { router ["GET", "HEAD"], $path, $app; }
my $match = $ROUTER.match( $req.method, $req.path-info ); return 405, [], ['Method Not Allowed'] if $match; with $match { my $c = Sixatra::Connection.new( :$req, :params($match) ); my $res = $match.app.($c); ...