Skip to content

Instantly share code, notes, and snippets.

@diegok
Created January 4, 2012 19:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diegok/1561712 to your computer and use it in GitHub Desktop.
Save diegok/1561712 to your computer and use it in GitHub Desktop.
Example mojo lite app sending plain json
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $self = shift;
$self->render( text => '{"json":"ok"}', status => 201, format => 'json');
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment