Commit 9af716d1 authored by Alexandre Delanoë's avatar Alexandre Delanoë

[COSMETICS]

parent dc3afe64
...@@ -284,7 +284,7 @@ server env = do ...@@ -284,7 +284,7 @@ server env = do
-- orchestrator <- scrapyOrchestrator env -- orchestrator <- scrapyOrchestrator env
pure $ swaggerFront pure $ swaggerFront
:<|> hoistServer (Proxy :: Proxy GargAPI) (`runReaderT` env) serverGargAPI :<|> hoistServer (Proxy :: Proxy GargAPI) (`runReaderT` env) serverGargAPI
:<|> serverIndex :<|> serverStatic
serverGargAPI :: GargServer GargAPI serverGargAPI :: GargServer GargAPI
serverGargAPI -- orchestrator serverGargAPI -- orchestrator
...@@ -302,9 +302,12 @@ serverGargAPI -- orchestrator ...@@ -302,9 +302,12 @@ serverGargAPI -- orchestrator
where where
fakeUserId = 1 -- TODO fakeUserId = 1 -- TODO
serverIndex :: Server (Get '[HTML] Html) serverStatic :: Server (Get '[HTML] Html)
serverIndex = $(do (Just s) <- liftIO (fileTypeToFileTree (FileTypeFile "purescript-gargantext/dist/index.html")) serverStatic = $(do
fileTreeToServer s) let path = "purescript-gargantext/dist/index.html"
Just s <- liftIO (fileTypeToFileTree (FileTypeFile path))
fileTreeToServer s
)
--------------------------------------------------------------------- ---------------------------------------------------------------------
swaggerFront :: Server SwaggerFrontAPI swaggerFront :: Server SwaggerFrontAPI
...@@ -315,11 +318,12 @@ gargMock :: Server GargAPI ...@@ -315,11 +318,12 @@ gargMock :: Server GargAPI
gargMock = mock apiGarg Proxy gargMock = mock apiGarg Proxy
--------------------------------------------------------------------- ---------------------------------------------------------------------
makeApp :: (HasConnection env, HasRepoVar env, HasRepoSaver env) => env -> IO Application makeApp :: (HasConnection env, HasRepoVar env, HasRepoSaver env)
=> env -> IO Application
makeApp = fmap (serve api) . server makeApp = fmap (serve api) . server
appMock :: Application appMock :: Application
appMock = serve api (swaggerFront :<|> gargMock :<|> serverIndex) appMock = serve api (swaggerFront :<|> gargMock :<|> serverStatic)
--------------------------------------------------------------------- ---------------------------------------------------------------------
api :: Proxy API api :: Proxy API
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment