Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created September 30, 2010 16:47
Show Gist options
  • Select an option

  • Save sharifulin/604897 to your computer and use it in GitHub Desktop.

Select an option

Save sharifulin/604897 to your computer and use it in GitHub Desktop.
Using Mojolcious-app in standalone script
use App;
use App::Controller;
my $self = App::Controller(app => App->new, tx => Mojo::Transaction::HTTP->new);
$self->helper(...);
$self->app->conf;
$self->app->db;
$self->render('not_found');
$self->mail(to => '..', from => '..', subject => '..');
delete $app->log->{path}; # логи в STDOUT
$app->renderer->root( .. ); # правильный путь к шаблонам, если был относительный
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment