aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordan <[email protected]>2024-04-20 14:27:44 -0400
committerdan <[email protected]>2024-04-20 14:27:44 -0400
commit46f9b059521cfb8f92adfc39a65abfe5063074fa (patch)
treef34e1b7e63a620ee7e905a8a2e4953c42111acc6
parent0f0b7f8b9dbe468eba2d491f6cc3c3088e7a4467 (diff)
downloadbizexp-46f9b059521cfb8f92adfc39a65abfe5063074fa.tar.gz
bizexp-46f9b059521cfb8f92adfc39a65abfe5063074fa.tar.bz2
bizexp-46f9b059521cfb8f92adfc39a65abfe5063074fa.zip
feat: serve elm app from server /
-rwxr-xr-xsrc/RestService.hs11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/RestService.hs b/src/RestService.hs
index 983deda..1236c44 100755
--- a/src/RestService.hs
+++ b/src/RestService.hs
@@ -33,15 +33,6 @@ addHeaders =
)
)
-staticFilePaths :: [FilePath]
-staticFilePaths = map ("./static/" ++) ["materialize.min.css", "materialize.min.js", "service.js"]
-
-staticFiles :: ScottyM ()
-staticFiles = do
- mapM_ addFile staticFilePaths
- where
- addFile path = get (capture $ tail path) $ file path
-
data ExprReq = ExprReq {expression :: L.Text, result :: Maybe L.Text}
deriving (Show, Generic)
@@ -71,7 +62,7 @@ insertRow s n row = atomically $ do
routes :: State -> ScottyM ()
routes state = do
S.middleware addHeaders
- staticFiles
+ get "/" $ file "./elm-client/index.html"
get "/t/dummy" $
S.json $ evalTableExpressions (TableExpressions dummyTable ["sum(2,3,5)", "any(0,0,1)", "sum(age, -10)", "any(0,1)"])
get "/t/:id" $