Created
July 28, 2009 19:56
-
-
Save perigrin/157633 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| dispatcher => ( | |
| '/' => 'index', | |
| '/login' => resource( | |
| representations => { | |
| 'text/html' => sub {'<h1>Comming Soon</h1>'} | |
| }, | |
| ); | |
| ); | |
| resource index( Request $r) with( | |
| Authentication('OpenID'), | |
| Storage('JSON'), | |
| Template('TT2'), | |
| ) { | |
| has valid_users => ( | |
| isa => 'HashRef', | |
| lazy_build => 1, | |
| traits => ['Hash'], | |
| handles => { | |
| exists => 'is_authorized', | |
| } | |
| ); | |
| sub _build_valid_users { { 'chris.prather.org' => 1 } } | |
| method content { { title => 'hello world' } } | |
| template q[<h1>[% this.title %]</h2>]; | |
| representations { | |
| 'text/html' => 'render_template', | |
| 'text/json' => 'freeze', # provided by Storage | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment