Index: /trunk/app.psgi
===================================================================
--- /trunk/app.psgi	(revision 64)
+++ /trunk/app.psgi	(revision 65)
@@ -9,12 +9,13 @@
 use BookmarkController;
 
-#TODO: allow a different config file on the command line, or set options from the command line
+#TODO: allow individual options to be set via environment vars, too
 
--e 'conf.yml' or die "Missing required conf.yml config file\n";
+-e $ENV{CONFIG_FILE} or die "Config file $ENV{CONFIG_FILE} not found\n";
 
-my $config = YAML::LoadFile('conf.yml');
+my $config = YAML::LoadFile($ENV{CONFIG_FILE});
 
 sub get_controller {
-    my $req = shift;
+    my $env = shift;
+    my $req = Plack::Request->new($env);
 
     return BookmarkController->new({
@@ -28,6 +29,5 @@
         GET {
             my ($env) = @_;
-            my $req = Plack::Request->new($env);
-            my $controller = get_controller($req);
+            my $controller = get_controller($env);
 
             # check for a uri param, and if there is one present,
@@ -35,5 +35,5 @@
             # redirect to that bookmark, and if not, show the form
             # to create a new bookmark
-            if (defined $req->param('uri')) {
+            if (defined $controller->request->param('uri')) {
                 return $controller->find_or_new;
             }
@@ -44,6 +44,5 @@
         POST {
             my ($env) = @_;
-            my $req = Plack::Request->new($env);
-            my $controller = get_controller($req);
+            my $controller = get_controller($env);
 
             # create the bookmark and redirect to the new bookmark's edit form
@@ -55,6 +54,5 @@
         GET {
             my ($env) = @_;
-            my $req = Plack::Request->new($env);
-            my $controller = get_controller($req);
+            my $controller = get_controller($env);
 
             return $controller->list;
@@ -65,6 +63,5 @@
         GET {
             my ($env) = @_;
-            my $req = Plack::Request->new($env);
-            my $controller = get_controller($req);
+            my $controller = get_controller($env);
 
             return $controller->feed;
@@ -75,6 +72,5 @@
         GET {
             my ($env, $params) = @_;
-            my $req = Plack::Request->new($env);
-            my $controller = get_controller($req);
+            my $controller = get_controller($env);
 
             return $controller->view($params->{id});
@@ -82,6 +78,5 @@
         POST {
             my ($env, $params) = @_;
-            my $req = Plack::Request->new($env);
-            my $controller = get_controller($req);
+            my $controller = get_controller($env);
 
             return $controller->update_and_redirect($params->{id});
@@ -92,6 +87,5 @@
         GET {
             my ($env, $params) = @_;
-            my $req = Plack::Request->new($env);
-            my $controller = get_controller($req);
+            my $controller = get_controller($env);
 
             return $controller->view_field($params->{id}, $params->{field});
Index: /trunk/start
===================================================================
--- /trunk/start	(revision 64)
+++ /trunk/start	(revision 65)
@@ -1,3 +1,5 @@
 #!/bin/sh
 
+export CONFIG_FILE=${1:-"conf.yml"}
+
 starman --listen :5000 --daemonize --pid pid --error-log errors --access-log access
Index: /trunk/stop
===================================================================
--- /trunk/stop	(revision 65)
+++ /trunk/stop	(revision 65)
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+kill `cat pid`
