    ["-h" "--help" "Show help"]
    ["-H" "--host HOST" "Set host for listening socket" :default "localhost"]
    ["-r" "--root DIR" "Set document root directory" :default docroot-default]
+   ["-D" "--localdev" "Allow CORS from localhost" :default false]
    ["-d" "--database FILE" "Database to use" :default db-default]
    [nil "--logfile FILE" "Log file to use" :default logfile-default]
    [nil "--keyfile FILE" "Private key file to use (requires --certfile)"]

                              (println "Failed to start gui. Logging error.")
                              (error "Failed to start gui." ex)))))
                      (when (:serve options)
                        (serv (get-app docroot db loader port userauth) host port keystore))))))
        (catch Exception ex
          ; XXX maybe should enable ERROR logging to console, instead of this.
          (binding [*out* *err*]

    app))

; XXX add ring jsonp?
(defn- get-app [docroot db loader port userauth allow-hosts]
  (-> cavm.views.datasets/routes
      (wrap-authentication userauth port)
      (wrap-trace :header :ui)
