Skip to content

Instantly share code, notes, and snippets.

@shrayasr
Last active August 29, 2015 14:27
Show Gist options
  • Save shrayasr/b03a5747abc4b03a76a3 to your computer and use it in GitHub Desktop.
Save shrayasr/b03a5747abc4b03a76a3 to your computer and use it in GitHub Desktop.
lein-ring setting readonly attribute to files on windows
# Start a new compojure project
$ lein new compojure win-ro-problem-test
(ns win-ro-problem-test.handler
(:gen-class)
(:require [compojure.core :refer :all]
[compojure.route :as route]
[ring.adapter.jetty :as jetty]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
(defroutes app-routes
(GET "/" [] "Hello World")
(GET "/foo" [] "Foo")
(route/not-found "Not Found"))
(def app
(wrap-defaults app-routes site-defaults))
(defn -main []
(jetty/run-jetty app 3500))
(defproject win-ro-problem-test "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.6.0"]
[compojure "1.3.1"]
[ring/ring-defaults "0.1.2"]
[ring/ring-jetty-adapter "1.4.0"]]
:plugins [[lein-ring "0.8.13"]]
:ring {:handler win-ro-problem-test.handler/app}
:main win-ro-problem-test.handler
:aot :all
:profiles
{:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring-mock "0.1.5"]]}})
diff --git a/project.clj b/project.clj
index f8ad2c3..44e4658 100644
--- a/project.clj
+++ b/project.clj
@@ -4,9 +4,12 @@
:min-lein-version "2.0.0"
:dependencies [[org.clojure/clojure "1.6.0"]
[compojure "1.3.1"]
- [ring/ring-defaults "0.1.2"]]
+ [ring/ring-defaults "0.1.2"]
+ [ring/ring-jetty-adapter "1.4.0"]]
:plugins [[lein-ring "0.8.13"]]
:ring {:handler win-ro-problem-test.handler/app}
+ :main win-ro-problem-test.handler
+ :aot :all
:profiles
{:dev {:dependencies [[javax.servlet/servlet-api "2.5"]
[ring-mock "0.1.5"]]}})
diff --git a/src/win_ro_problem_test/handler.clj b/src/win_ro_problem_test/handler.clj
index d5483bb..ffcec5c 100644
--- a/src/win_ro_problem_test/handler.clj
+++ b/src/win_ro_problem_test/handler.clj
@@ -1,6 +1,8 @@
(ns win-ro-problem-test.handler
+ (:gen-class)
(:require [compojure.core :refer :all]
[compojure.route :as route]
+ [ring.adapter.jetty :as jetty]
[ring.middleware.defaults :refer [wrap-defaults site-defaults]]))
(defroutes app-routes
@@ -10,3 +12,6 @@
(def app
(wrap-defaults app-routes site-defaults))
+
+(defn -main []
+ (jetty/run-jetty app 3500))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment