Index: trunk/index.cgi
===================================================================
--- trunk/index.cgi	(revision 30)
+++ trunk/index.cgi	(revision 41)
@@ -19,3 +19,12 @@
 
 package main;
-BookmarkApp::Dispatch->dispatch();
+# check for whether we are behind a reverse proxy, and adjust the SERVER_NAME accordingly
+# TODO: use something like Plack::Middlware::ReverseProxy instead
+$ENV{SERVER_NAME} = $ENV{HTTP_X_FORWARDED_HOST} if $ENV{HTTP_X_FORWARDED_HOST};
+
+BookmarkApp::Dispatch->dispatch(
+    args_to_new => {
+        #TODO: dbname should be in a config file
+        PARAMS => { dbname => 'fk.db' },
+    }
+);
