 
 (defn logs [app-name user]
   (let [{cli :client} (first (pick-backends))
-        resp (container/logs cli (app->id app-name user) :stdout true :stderr true)]
+        resp (container/logs cli (-> app-name instances first :id) :stdout true :stderr true)]
     (map #(str (name (:stream-type %))
                ": "
                (:body %)) resp)))

        url (str "http://" (urly/host-of host) ":" port)]
    url))

(defn app->id [app-name user]
  (get-in @apps [(keyword app-name) :instances 0 :id]))

(defn create [app-name user image & {:keys [tag command port]}]
  (let [backends (pick-backends)
        front-url (default-frontend-url app-name)
        old-isntances (get-in @apps [(keyword app-name) :instances])
        new-instances (vec (for [{cli :client host-port :port} backends]
                             (let [id (docker/run cli image
                                        :tag tag

  )

(defn delete [app-name user]
  (let [is (instances app-name)]
    (delete-instances is)
    (delete-app app-name)
    (router/delete-domain (default-frontend-url app-name))
    nil))

