From bcc5474370436b1a6e370e7677f0cdaeee7c9541 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Mon, 13 Mar 2023 07:25:42 -0600 Subject: [PATCH] try to refactor ksr-express image serving --- projects/ksr-express/src/ksr_express/Engine.kiss | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/projects/ksr-express/src/ksr_express/Engine.kiss b/projects/ksr-express/src/ksr_express/Engine.kiss index 307767f6..20b21d68 100644 --- a/projects/ksr-express/src/ksr_express/Engine.kiss +++ b/projects/ksr-express/src/ksr_express/Engine.kiss @@ -12,11 +12,9 @@ port 3000 staticDir (#if STATIC_DIR (#value "STATIC_DIR") (Sys.getCwd))] (print "Using $staticDir for static file directory") - (app.use (Express.static_.call staticDir)) + (app.use "/static" (Express.static_.call staticDir)) (app.get "/" ->[req :Dynamic res next] (res.send content)) - (app.get "/image/:path" ->[:Dynamic req :Dynamic res next] - (res.sendFile req.params.path (object root (Sys.getCwd)))) (app.get "/continue" ->[req res next] { (whenLet [_cc cc] (set cc null) (_cc)) (res.redirect "/") @@ -43,7 +41,7 @@ (+= content text "
")) (method :Void showImage [path] - (+= content "
")) + (+= content "
")) (method :Void delayForUserInput [cc] (set this.cc cc)