         basedir (or (:catacumba-basedir env) basedir)
         debug (or (:catacumba-debug env) debug)
         sslcontext (build-ssl-context keystore)
-        config (if (string? basedir)
-                 (ServerConfig/baseDir ^Path (utils/str->path basedir))
-                 (try
-                   (ServerConfig/findBaseDir ".catacumba")
-                   (catch RuntimeException e
-                     (ServerConfig/noBaseDir))))]
+        config (ServerConfig/builder)]
+    (if (string? basedir)
+      (.baseDir config ^Path (utils/str->path basedir))
+      (try
+        (let [^Path path (BaseDir/find ".catacumba")]
+          (.baseDir config path))
+        (catch IllegalStateException e
+          ;; Do Nothing explicitly
+          )))
     (when sslcontext (.ssl config sslcontext))
     (when public-address (.publicAddress config (java.net.URI. public-address)))
     (when max-body-size (.maxContentLength config max-body-size))

  "The ratpack server configuration callback."
  [^RatpackServerSpec spec handler {:keys [setup] :as options}]
  (.serverConfig spec ^ServerConfig (build-server-config options))
  (.registryOf spec (helpers/action #(bootstrap-registry % options)))
  (setup-handler handler spec))

(defn run-server

  "
  ([handler] (run-server handler {}))
  ([handler options]
   (let [^Action callback (ch/fn->action #(configure-server % handler options))
         ^RatpackServer server (RatpackServer/of callback)]
     (.start server)
    server)))
