Skip to content

Instantly share code, notes, and snippets.

@anildigital anildigital/core.clj Secret
Created Feb 17, 2015

Embed
What would you like to do?
(ns clojurebyexample.core
(:require [ring.adapter.jetty :as jetty]
[environ.core :refer [env]])
(:use ring.middleware.resource)
(:use ring.middleware.file)
(:use ring.middleware.file-info)
)
(defn handler [request]
{:status 302
:headers {"Location" "/toc.html"}
})
(defn -main [& [port]]
(let [port (Integer. (or port (env :port) 5000))]
(jetty/run-jetty (-> #'handler (wrap-resource "output" )) {:port port :join? false})))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.