diff --git a/shrlbe.pl b/shrlbe.pl index 6e35b30..ff5141d 100644 --- a/shrlbe.pl +++ b/shrlbe.pl @@ -18,6 +18,13 @@ get '/' => sub ($c) { $c->render(template => 'index', page_data => {}); }; +get '/s/*url' => sub ($c) { + my $url = normalize_source_url($c->param('url')); + my $shorten_path = write_url($url); + my $shorten_url = $SITE_NAME.$shorten_path; + $c->render(text => $shorten_url); +}; + post '/' => sub ($c) { my $url = normalize_source_url($c->param('url')); my $shorten_path = write_url($url);