 (ns just-married.api
   (:gen-class)
   (:require [buddy.auth :refer [authenticated? throw-unauthorized]]
-            [buddy.auth.accessrules :refer [restrict]]
             [buddy.auth.backends.httpbasic :refer [http-basic-backend]]
             [buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
             [hiccup.core :as html]


(defn- detect-language
  "Lookup in the request to find out what should be the default language to serve"
  [request]
  :en)

(defn guest-list
  "Page showing the list of guests, needs to be authenticated"

(defroutes app-routes
  (GET "/" [] (render-page :initial :en))
  (GET "/enter" [] (render-page :initial :en))
  ;; do a redirect adding the extra information
  (GET "/main" request (render-page :home (detect-language request available-languages)))
  (GET "/guests" request (guest-list request)))

(def app
