Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (ns hello-ring.core2
- (:require [compojure.core :refer :all]
- [clojure.string :refer [starts-with?]]
- [compojure.route :as route])
- (:use ring.middleware.file
- ring.middleware.resource
- ring.middleware.content-type
- ring.middleware.not-modified))
- (def root "/home/aleksandr/projects/hello-ring/resources/public")
- (defn handler
- [request]
- {:status 200
- :headers {"Content-Type" "text/plain"}})
- (defn debug [request]
- (prn "request after all transforms" request)
- request)
- (defroutes my-routes
- (GET "/" [] "Hello World")
- (route/files "/" (do (println root) {:root root}))
- (route/resources "/")
- (route/not-found "Not Found"))
- (def app
- (-> my-routes
- ; (wrap-resource root)
- (wrap-content-type)
- (wrap-not-modified)
- debug))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement