Created
March 20, 2013 15:18
-
-
Save bduggan/5205520 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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