Created
October 1, 2012 11:15
-
-
Save Akron/3811025 to your computer and use it in GitHub Desktop.
Start App with a script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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