Advertisement
Guest User

Untitled

a guest
Oct 30th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (ns my-webapp.handler
  2.   (:require [my-webapp.views :as views] ; add this require
  3.             [compojure.core :refer :all]
  4.             [compojure.route :as route]
  5.             [ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
  6.  
  7. (defroutes app-routes ; replace the generated app-routes with this
  8.   (GET "/"
  9.        []
  10.        (views/home-page))
  11.   (GET "/add-location"
  12.        []
  13.        (views/add-location-page))
  14.   (POST "/add-location"
  15.         {params :params}
  16.         (views/add-location-results-page params))
  17.   (GET "/location/:loc-id"
  18.        [loc-id]
  19.        (views/location-page loc-id))
  20.   (GET "/all-locations"
  21.        []
  22.        (views/all-locations-page))
  23.   (route/resources "/")
  24.   (route/not-found "Not Found"))
  25.  
  26. (def app
  27.   (wrap-defaults app-routes site-defaults))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement