     (if (fs/exists? build ) build bin)))
 
 (defroutes static-routes 
+  (GET "/login" [] (ring.util.response/file-response "assets/login.html" {:root (static-path)}))
   (route/files "/" {:root (static-path)}))
 
+(defroutes sessions
+  (friend/logout (ANY "/logout" request  (ring.util.response/redirect "/"))))
+
 (defroutes app-routes
-  static-routes system type environments actions jobs (friend/wrap-authorize users admin)
+  system type environments actions jobs sessions (friend/wrap-authorize users admin)
   (friend/wrap-authorize quotas admin) (route/not-found "Not Found"))
 
 (defn error-wrap

  "The api routes, secured? will enabled authentication"
  (-> (compose-routes secured?) 
      (wrap-swag) 
      (handler/api)
      (wrap-restful-format :formats [:json-kw :edn :yaml-kw :yaml-in-html])
      (mp/wrap-multipart-params)

(ns celestial.api
  (:refer-clojure :exclude [hash type])
  (:use 
    [celestial.hosts-api :only (system type environments)]
    [celestial.users-api :only (users quotas)]
    [gelfino.timbre :only (get-tid)]
    [compojure.core :only (defroutes routes)] 
    [metrics.ring.expose :only  (expose-metrics-as-json)]
    [celestial.roles :only (roles roles-m admin)]
    [clojure.core.strint :only (<<)]
    [slingshot.slingshot :only  [throw+ try+]]
    [ring.middleware.format :only [wrap-restful-format]]
    [ring.middleware.params :only (wrap-params)]
    [metrics.ring.instrument :only  (instrument)]
    [swag.model :only (defmodel wrap-swag defv defc)]
    [celestial.common :only (import-logging get! resp bad-req conflict success version wrap-errors)])
  (:require 
    [ring.middleware.session.cookie :refer (cookie-store)]
    [ring.middleware.session :refer (wrap-session)]
    [compojure.core :refer (GET ANY)] 
    [me.raynes.fs :as fs]
    [swag.core :refer (swagger-routes GET- POST- PUT- DELETE- defroutes- errors )]
    [ring.middleware [multipart-params :as mp] ]
