             (route/resources "/ui" {:root "public/target"})
             )))
 
-(defonce pipe (atom nil))
-
 (defn start-server [port]
   (git/init-ssh!)
   (let [pipeline (lambdacd/assemble-pipeline pipe/pipeline-structure {:home-dir "tmp/foo"})]
-    (reset! pipe pipeline)
     (runners/start-one-run-after-another pipeline)
     (reset! server (http/run-server (pipeline-routes pipeline) {:port port}))))
 

    [compojure.route :as route])
  (:gen-class)
  )

(defn try-parse-int [port default-fn]
  (try (Integer/parseInt port) (catch NumberFormatException e (default-fn e))))

(defn pipeline-routes [pipeline]
  (ring-json/wrap-json-response
    (routes (context "/lambdaui/api" [] (new-api/api-routes pipeline))
            (POST "/lambdaui/api/triggerNew" [] (do (trigger-new pipeline) {}))
            (context "/api" [] (old-api/rest-api pipeline))
            (GET "/old" [] (old-ui/ui-page pipeline))
            (route/resources "/" {:root "public"})
