Skip to content

Instantly share code, notes, and snippets.

@Akron
Created October 1, 2012 11:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akron/3811025 to your computer and use it in GitHub Desktop.
Save Akron/3811025 to your computer and use it in GitHub Desktop.
Start App with a script
# test.pl:
#!/usr/bin/env perl
use TestApp;
TestApp->start;
# TestApp.pm:
package TestApp;
use Mojo::Base 'Mojolicious';
sub startup {
my $mojo = shift;
my $r = $mojo->routes;
$r->get('/')->to(
cb => sub {
shift->render_text('Hi!');
});
};
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment