aboutsummaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorJasper Van der Jeugt2020-07-29 16:33:53 +0200
committerJasper Van der Jeugt2020-07-29 16:33:53 +0200
commitd6265dd7f44538858989c1fe6837e1cafc489455 (patch)
treee2f909606b57a8e2e745fcae6453bf99928762a9 /server
parent780527946548c68bfcfc4d8a99abf06b66cf23c1 (diff)
Further client stub
Diffstat (limited to 'server')
-rw-r--r--server/lib/Cafp/Main/Server.hs6
1 files changed, 5 insertions, 1 deletions
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"