Yancy
view release on metacpan or search on metacpan
eg/todo-app/myapp.pl view on Meta::CPAN
state $sqlite = Mojo::SQLite->new( 'sqlite:' . $path );
return $sqlite;
};
app->sqlite->auto_migrate(1)->migrations->from_data;
# Login sessions expire after one week
app->sessions->default_expiration( 60 * 60 * 24 * 7 );
if ( my $path = $ENV{MOJO_REVERSE_PROXY} ) {
app->sessions->cookie_path( $ENV{MOJO_REVERSE_PROXY} );
my @parts = grep { $_ } split m{/}, $path;
app->hook( before_dispatch => sub {
my ( $c ) = @_;
my $url = $c->req->url;
my $base = $url->base;
# Append to the base path
push @{ $base->path }, @parts;
# The base must end with a slash, making http://example.com/todo/
$base->path->trailing_slash(1);
# and the URL must not, so that relative links on the home page work
# correctly
( run in 1.212 second using v1.01-cache-2.11-cpan-71847e10f99 )