Skip to content

Instantly share code, notes, and snippets.

@anildigital
Created January 4, 2014 16:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anildigital/2de18198a0f203135174 to your computer and use it in GitHub Desktop.
Save anildigital/2de18198a0f203135174 to your computer and use it in GitHub Desktop.
(ns clojurebyexample.core
(:use ring.adapter.jetty)
(:use ring.middleware.resource)
(:use ring.middleware.file)
(:use ring.middleware.file-info))
(defn handler [request]
{:status 200
:headers {"Content-Type" "text/plain"}
:body "Hello Another World"})
(def root (str (System/getProperty "user.dir") "/output"))
;; wrap the handler, to be able to add middleware etc
(def app (-> #'handler (wrap-resource root )))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment