ksr-express allow defining STATIC_DIR

This commit is contained in:
2023-03-10 09:57:42 -07:00
parent af8cab2a29
commit 071d551ad5

View File

@@ -10,7 +10,7 @@
&mut :Dynamic connection null] &mut :Dynamic connection null]
(let [app (Express.call) (let [app (Express.call)
port 3000] port 3000]
(app.use (Express.static_.call (Sys.getCwd))) (app.use (Express.static_.call (#if STATIC_DIR (#value STATIC_DIR) (Sys.getCwd))))
(app.get "/" ->[req :Dynamic res next] (app.get "/" ->[req :Dynamic res next]
(res.send content)) (res.send content))
(app.get "/image/:path" ->[:Dynamic req :Dynamic res next] (app.get "/image/:path" ->[:Dynamic req :Dynamic res next]