- Timestamp:
- 05/30/13 15:19:16 (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/BookmarkApp/Dispatch.pm
r41 r42 18 18 } 19 19 20 package main; 21 # check for whether we are behind a reverse proxy, and adjust the SERVER_NAME accordingly 22 # TODO: use something like Plack::Middlware::ReverseProxy instead 23 $ENV{SERVER_NAME} = $ENV{HTTP_X_FORWARDED_HOST} if $ENV{HTTP_X_FORWARDED_HOST}; 24 25 BookmarkApp::Dispatch->dispatch( 26 args_to_new => { 27 #TODO: dbname should be in a config file 28 PARAMS => { dbname => 'fk.db' }, 29 } 30 ); 20 # module return 21 1; -
trunk/index.cgi
r41 r42 2 2 use strict; 3 3 4 package BookmarkApp::Dispatch; 5 use base 'CGI::Application::Dispatch'; 4 use BookmarkApp::Dispatch; 6 5 7 sub 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 ':id?[post]' => { app => 'BookmarkApp', rm => 'edit' },16 ],17 };18 }19 20 package main;21 6 # check for whether we are behind a reverse proxy, and adjust the SERVER_NAME accordingly 22 7 # TODO: use something like Plack::Middlware::ReverseProxy instead
Note: See TracChangeset
for help on using the changeset viewer.