src/example/routes.clj
(ns example.routes)
handler
function to that namespace.
(ns example.routes)
(defn handler
[request]
{:status 200
:headers {"Content-Type" "text/html"}
:body "Hello, world"})
example.main
namespace refer to that
function.
Make sure to retain the #'
.
(ns example.main
(:require [ring.adapter.jetty :as jetty]
[example.routes :as routes]))
(defn -main []
(jetty/run-jetty #'routes/handler {:port 9999}))
just run
Nothing behavior-wise should be different.