Last change
on this file since 55 was
53,
checked in by peter, 11 years ago
|
- converted from a regular CGI application to a PSGI web application
- added an app.psgi main script
- use Plack::Middleware::ReverseProxy to adjust environment for when behind a reverse proxy
- use Plack::Middleware::Auth::Digest to do HTTP digest authentication for non-GET requests
- read in the db name, reverse proxy server IP, and digest password hash from a conf.yml config file
- use the CGI::url method instead of trying to build the base URI from the %ENV hash
- default to an empty tags parameter so split does not emit a warning
|
-
Property svn:executable set to
*
|
File size:
720 bytes
|
Rev | Line | |
---|
[2] | 1 | #!/usr/bin/perl -w |
---|
| 2 | use strict; |
---|
| 3 | |
---|
[23] | 4 | package BookmarkApp::Dispatch; |
---|
[53] | 5 | use base 'CGI::Application::Dispatch::PSGI'; |
---|
[23] | 6 | |
---|
| 7 | sub dispatch_args { |
---|
| 8 | return { |
---|
| 9 | table => [ |
---|
[30] | 10 | '[get]' => { app => 'BookmarkApp', rm => 'list' }, |
---|
| 11 | 'list[get]' => { app => 'BookmarkApp', rm => 'list' }, |
---|
| 12 | 'feed[get]' => { app => 'BookmarkApp', rm => 'feed' }, |
---|
| 13 | ':id[get]' => { app => 'BookmarkApp', rm => 'view' }, |
---|
| 14 | ':id/:field[get]' => { app => 'BookmarkApp', rm => 'view_field' }, |
---|
[45] | 15 | '[post]' => { app => 'BookmarkApp', rm => 'create' }, |
---|
| 16 | ':id[post]' => { app => 'BookmarkApp', rm => 'edit' }, |
---|
[23] | 17 | ], |
---|
| 18 | }; |
---|
| 19 | } |
---|
| 20 | |
---|
[42] | 21 | # module return |
---|
| 22 | 1; |
---|
Note: See
TracBrowser
for help on using the repository browser.