Skip to content

Instantly share code, notes, and snippets.

@dagolden
Created June 19, 2013 00:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dagolden/5810631 to your computer and use it in GitHub Desktop.
Save dagolden/5810631 to your computer and use it in GitHub Desktop.
#!/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