Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 32 lines (24 sloc) 0.441 kb
0024c72 @tadzik Initial commit
authored
1 use Bailador;
2
3 # simple cases
4 get '/' => sub {
5 "hello world"
d8574ae @tadzik Add templating support, needs Ratel
authored
6 }
0024c72 @tadzik Initial commit
authored
7
8 get '/about' => sub {
9 "about me"
d8574ae @tadzik Add templating support, needs Ratel
authored
10 }
0024c72 @tadzik Initial commit
authored
11
12 # regexes, as usual
13 get /foo(.+)/ => sub ($x) {
14 "regexes! I got $x"
15 }
16
17 get / '/' (.+) '-' (.+)/ => sub ($x, $y) {
18 "$x and $y"
19 }
20
21 # junctions work too
22 get any('/h', '/help', '/halp') => sub {
23 "junctions are cool"
24 }
25
d8574ae @tadzik Add templating support, needs Ratel
authored
26 # templates!
27 get / ^ '/template/' (.+) $ / => sub ($x) {
28 template 'tmpl.tt', { name => $x }
29 }
30
f3b044c @tadzik Fixed a grammar-o, sorear++
authored
31 baile;
Something went wrong with that request. Please try again.