Skip to content

Instantly share code, notes, and snippets.

@bduggan
Created March 20, 2013 15:18
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 bduggan/5205520 to your computer and use it in GitHub Desktop.
Save bduggan/5205520 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/reference/:doi' => sub {
my $c = shift;
my $doi = $c->stash('doi');
$c->render_json({
author => "Author id goes here",
journal => "The great journal with doi $doi",
pages => "random pages"
});
};
get '/' => 'index';
app->start;
__DATA__
@@ index.html.ep
%= javascript '/mojo/jquery/jquery.js';
<span id='foo'></span>
%= javascript begin
$(document).ready(function() {
$("#foo").html("hello, world");
});
%= end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment