From 02bfe08a2376269bdada4e21a5a6f86c2bd445e0 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 15 Aug 2011 22:58:53 +0200 Subject: cgi: Shorter paths --- cgi/index.pl | 10 ++++++++-- 1 file 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__ -- cgit v1.2.3