Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created July 21, 2010 07:59
Show Gist options
  • Save sharifulin/484208 to your computer and use it in GitHub Desktop.
Save sharifulin/484208 to your computer and use it in GitHub Desktop.
Idea for Mojolicious::Lite app
#!/usr/bin/env perl
use Mojolicious::Lite;
use App::Foo;
use App::Bar;
for (ref app) {
$_->attr(db => sub { ... });
$_->attr(conf => sub { ... });
}
app->types->type(json => 'text/plain');
app->log->level('warn');
plugin '...';
# include routes and App::*
app->start;
package App::Foo;
use Mojolicious::Lite;
get '/foo' => sub { .. };
1;
package App::Bar;
use Mojolicious::Lite;
get '/' => sub { .. };
get '/bar' => sub { .. };
1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment