diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-08-15 22:58:53 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-08-15 22:58:53 +0200 |
commit | 02bfe08a2376269bdada4e21a5a6f86c2bd445e0 (patch) | |
tree | f9c2ccb4a1d9d58ce55f05855c2cd1fd81b1186b | |
parent | 2505244db4689b848273a59ab2af0c87fd8eb816 (diff) |
cgi: Shorter paths
-rw-r--r-- | cgi/index.pl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cgi/index.pl b/cgi/index.pl index a8c9f25..23f08f3 100644 --- a/cgi/index.pl +++ b/cgi/index.pl @@ -33,10 +33,10 @@ get '/' => sub { if ( not $station ) { return $self->render; } - $self->redirect_to("/multi/${station}"); + $self->redirect_to("/${station}"); } => 'index'; -get '/multi/:station' => sub { +get '/:station' => sub { my $self = shift; my $station = $self->stash('station'); @@ -73,6 +73,12 @@ get '/multi/:station' => sub { $self->render( text => $template->output ); }; +get '/multi/:station' => sub { + my $self = shift; + my $station = $self->stash('station'); + $self->redirect_to("/${station}"); +}; + app->start(); __DATA__ |