Commit 3991d01e authored by Przemyslaw Kaminski's avatar Przemyslaw Kaminski

[static] use servant static file server

This is instead of the Servant.Static.TH which bundles the files at
compilation into the binary.
parent 37477a45
from fpco/stack-build:lts-14.22
from fpco/stack-build:lts-14.6
RUN apt-get update && \
apt-get install -y git libigraph0-dev && \
......
......@@ -319,7 +319,7 @@ type GargPrivateAPI' =
type API = SwaggerAPI
:<|> FrontEndAPI
:<|> Get '[HTML] Html
-- :<|> Get '[HTML] Html
:<|> GargAPI
-- This is the concrete monad. It needs to be used as little as possible,
......@@ -341,7 +341,7 @@ server env = do
-- orchestrator <- scrapyOrchestrator env
pure $ schemaUiServer swaggerDoc
:<|> frontEndServer
:<|> serverStatic
-- :<|> serverStatic
:<|> hoistServerWithContext (Proxy :: Proxy GargAPI) (Proxy :: Proxy AuthContext) transform serverGargAPI
where
transform :: forall a. GargServerM env GargError a -> Handler a
......
......@@ -12,15 +12,16 @@ Loads all static file for the front-end.
-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
---------------------------------------------------------------------
module Gargantext.API.FrontEnd where
import Servant.Static.TH (createApiAndServerDecs)
import Servant
import Servant.Server.StaticFiles (serveDirectoryWebApp)
---------------------------------------------------------------------
$(createApiAndServerDecs "FrontEndAPI" "frontEndServer" "purescript-gargantext/dist")
---------------------------------------------------------------------
type FrontEndAPI = Raw
frontEndServer :: Server FrontEndAPI
frontEndServer = serveDirectoryWebApp "./purescript-gargantext/dist"
resolver: lts-14.22
resolver: lts-14.27
flags: {}
extra-package-dbs: []
packages:
......@@ -7,7 +7,7 @@ packages:
docker:
enable: false
repo: 'fpco/stack-build:lts-14.22-garg'
repo: 'fpco/stack-build:lts-14.27-garg'
nix:
enable: false
......@@ -72,6 +72,7 @@ extra-deps:
- serialise-0.2.0.0
- servant-flatten-0.2
#- servant-multipart-0.11.2
- servant-server-0.16
- stemmer-0.5.2
- time-units-1.0.0
- validity-0.9.0.0 # patches-{map,class}
......
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