From d6265dd7f44538858989c1fe6837e1cafc489455 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Wed, 29 Jul 2020 16:33:53 +0200 Subject: Further client stub --- server/lib/Cafp/Main/Server.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server') diff --git a/server/lib/Cafp/Main/Server.hs b/server/lib/Cafp/Main/Server.hs index 5de7403..fdace52 100644 --- a/server/lib/Cafp/Main/Server.hs +++ b/server/lib/Cafp/Main/Server.hs @@ -22,9 +22,13 @@ newServer = Server <$> newTVar HMS.empty main :: IO () main = Scotty.scotty 3000 $ do - Scotty.get "/rooms/:id" $ do + Scotty.get "/rooms/:id/" $ do roomId <- Scotty.param "id" when (T.length roomId < 6) $ Scotty.raise "Room ID should be at least 6 characters" Scotty.setHeader "Content-Type" "text/html" Scotty.file "assets/client.html" + + Scotty.get "/assets/client.js" $ do + Scotty.setHeader "Content-Type" "application/JavaScript" + Scotty.file "assets/client.js" -- cgit v1.2.3