Skip to content

Instantly share code, notes, and snippets.

@jacoelho
Last active July 31, 2016 19:21
Show Gist options
  • Save jacoelho/4f2591beb4acefe5dc9ca601a57907b4 to your computer and use it in GitHub Desktop.
Save jacoelho/4f2591beb4acefe5dc9ca601a57907b4 to your computer and use it in GitHub Desktop.
(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