Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created November 26, 2017 03:37
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 zoffixznet/68fc6b860f2bb34318cdbc8c5f8622c7 to your computer and use it in GitHub Desktop.
Save zoffixznet/68fc6b860f2bb34318cdbc8c5f8622c7 to your computer and use it in GitHub Desktop.
sub startup {
my $self = shift;
my $r = $self->routes;
$r->get('/' => sub {
shift->render(
text => <<'END'
<form action="/upload" method="post" enctype="multipart/form-data">
<input type="submit" class="button" value="Send">
<input id="file_upload" type="file" name="file">
</form>
END
);
});
$r->post('/upload' => sub {
print "Test\n";
shift->render(json => { status => 'ok' })
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment