Skip to content

Instantly share code, notes, and snippets.

➜ hello-api-clojure git:(master) ✗ lein new pedestal-service hello-api-clojure
lein new pedestal-service hello-api-clojure
Creating your server...
INFO org.eclipse.jetty.server.Server - jetty-9.4.0.v20161208
INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@e7529ac{/,null,AVAILABLE}
INFO o.e.jetty.server.AbstractConnector - Started ServerConnector@297c0311{HTTP/1.1,[http/1.1, h2c]}{0.0.0.0:8080}
INFO org.eclipse.jetty.server.Server - Started @7735ms
(defn get-json
[request]
(ring-resp/response {:foo "foo" :list [1 2 3 4]}))
;; Tabular routes
(def routes #{["/" :get (conj common-interceptors `home-page)]
["/about" :get (conj common-interceptors `about-page)]
["/json" :get (conj common-interceptors-json `get-json)]})
(def common-interceptors-json [(body-params/body-params) http/json-body])
{
"foo": "foo",
"list": [
1,
2,
3,
4
]
}
lein new luminus hello-web-app
➜ hello-web-app git:(master) ✗ lein run
2017-08-13 16:37:33,317 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
2017-08-13 16:37:33,706 [main] INFO hello-web-app.env -
-=[hello-web-app started successfully using the development profile]=-
2017-08-13 16:37:33,831 [main] INFO luminus.http-server - starting HTTP server on port 3000
2017-08-13 16:37:33,899 [main] INFO org.xnio - XNIO version 3.3.6.Final
2017-08-13 16:37:34,435 [main] INFO org.projectodd.wunderboss.web.Web - Registered web context /
2017-08-13 16:37:34,438 [main] INFO luminus.repl-server - starting nREPL server on port 7000
2017-08-13 16:37:34,461 [main] INFO hello-web-app.core - #'hello-web-app.config/env started
2017-08-13 16:37:34,461 [main] INFO hello-web-app.core - #'hello-web-app.handler/init-app started