source: bookmarks/trunk/BookmarkApp/Dispatch.pm @ 59

Last change on this file since 59 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
Line 
1#!/usr/bin/perl -w
2use strict;
3
4package BookmarkApp::Dispatch;
5use base 'CGI::Application::Dispatch::PSGI';
6
7sub dispatch_args {
8    return {
9        table => [
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' },
15            '[post]'          => { app => 'BookmarkApp', rm => 'create' },
16            ':id[post]'       => { app => 'BookmarkApp', rm => 'edit' },
17        ],
18    };
19}
20
21# module return
221;
Note: See TracBrowser for help on using the repository browser.