Last active
July 31, 2016 19:21
-
-
Save jacoelho/4f2591beb4acefe5dc9ca601a57907b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns todo-rest.core | |
| (:require [ring.adapter.jetty :as jetty] | |
| [ring.middleware.reload :refer [wrap-reload]] | |
| [compojure.core :refer [defroutes context GET POST PUT DELETE]] | |
| [compojure.route :refer [not-found]]) | |
| (:gen-class)) | |
| (defroutes app-routes | |
| (GET "/" [] {:status 200 :body "hello world" :headers {}}) | |
| (not-found "sorry")) | |
| (def app | |
| app-routes) | |
| (defn -dev-main | |
| "dev simple app" | |
| [] | |
| (jetty/run-jetty (wrap-reload #'app) | |
| {:port (Integer. (get (System/getenv) "PORT" "8000"))})) | |
| (defn -main | |
| "simple app" | |
| [] | |
| (jetty/run-jetty app | |
| {:port (Integer. (get (System/getenv) "PORT" "8000"))})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment