Created
June 19, 2013 00:04
-
-
Save dagolden/5810631 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.10; | |
use strict; | |
use warnings; | |
use Dancer2; | |
set session => 'Simple'; | |
hook before => sub { | |
return if request->path_info =~ m{^/there$}; | |
session 'foo' => 'bar'; | |
redirect "/there"; | |
}; | |
get '/' => sub { | |
return "index"; | |
}; | |
get '/there' => sub { | |
return session('foo'); | |
}; | |
start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment