From 46f9b059521cfb8f92adfc39a65abfe5063074fa Mon Sep 17 00:00:00 2001 From: dan Date: Sat, 20 Apr 2024 14:27:44 -0400 Subject: feat: serve elm app from server / --- src/RestService.hs | 11 +---------- 1 file changed, 1 insertion(+), 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" $ -- cgit v1.2.3