Skip to content

Commit

Permalink
Added basic support for URL submission.
Browse files Browse the repository at this point in the history
  • Loading branch information
davorg committed Sep 25, 2012
1 parent 0270578 commit 58db343
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Shrtr/lib/Shrtr.pm
Expand Up @@ -14,6 +14,21 @@ get '/register' => sub {
template 'register';
};

get '/submit' => sub {
template 'submit';
};

post '/submit' => sub {
if (my $url = param('url') and my $code = param('code')) {
my $new_url = $url_rs->create({
url => $url,
code => $code,
});

template 'saved', { url => $new_url };
}
};

get qr{ /(\w+)\+ }x => sub {
my ($code) = splat;

Expand Down

0 comments on commit 58db343

Please sign in to comment.