Skip to content

Instantly share code, notes, and snippets.

@brianmed
Last active April 2, 2016 04:23
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 brianmed/4f6e26af5ec56fd0f6b469fb30373ed3 to your computer and use it in GitHub Desktop.
Save brianmed/4f6e26af5ec56fd0f6b469fb30373ed3 to your computer and use it in GitHub Desktop.
Smallish Mojolicious::Lite app example
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $c = shift->render_later;
app->log->debug("$c");
Mojo::IOLoop->timer(0.1 => sub {
my $loop = shift;
$c->render(text => sprintf("%s\n", scalar(localtime)));
app->log->debug("$c");
});
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment