This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-12
Channels
- # announcements (1)
- # babashka (124)
- # beginners (98)
- # calva (54)
- # cider (32)
- # cljdoc (5)
- # cljs-dev (131)
- # cljsrn (1)
- # clojure (107)
- # clojure-australia (2)
- # clojure-europe (2)
- # clojure-losangeles (1)
- # clojure-norway (3)
- # clojure-uk (28)
- # clojurescript (21)
- # conjure (86)
- # core-async (7)
- # cursive (3)
- # datascript (5)
- # datomic (28)
- # defnpodcast (2)
- # devcards (1)
- # exercism (47)
- # fulcro (22)
- # graalvm (29)
- # graphql (1)
- # malli (5)
- # nrepl (31)
- # off-topic (111)
- # re-frame (23)
- # reitit (4)
- # spacemacs (6)
- # tools-deps (10)
- # tree-sitter (1)
- # xtdb (6)
I'm struggling to get static resources working with reitit and http-kit. Requesting /
returns the expected "ok!" response but requesting /js/app.js
(which is definitely there, in the public
dir) returns the 404 Not Found
response:
(ns rtc.server
(:require
[org.httpkit.server :as http]
[reitit.ring :as ring]))
(defn handler [_]
{:status 200
:headers {"Content-Type" "text/html; charset=utf-8"}
:body "ok!"})
(def app (ring/ring-handler
(ring/router
[["/" {:get handler}]
["/ping" (constantly {:status 200 :body "ok"})]])
(ring/routes
(ring/create-resource-handler {:path "/"})
(ring/create-default-handler
{:not-found (constantly {:status 404
:headers {"Content-Type" "text/plain; charset=utf-8"}
:body "Not Found"})}))))
(defonce stop-fn (atom nil))
(defn start [& [opts]]
(let [port (:port opts 3000)]
(reset! stop-fn (http/run-server app {:port port})))
nil)
Any tips for how to debug?