From fc6cf6169868e60c189e4b243330c3717ff159f3 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Thu, 26 May 2022 13:58:07 +0200 Subject: ... --- overlays/spm/server/Spm/Server/UI.hs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 overlays/spm/server/Spm/Server/UI.hs (limited to 'overlays/spm/server/Spm/Server/UI.hs') diff --git a/overlays/spm/server/Spm/Server/UI.hs b/overlays/spm/server/Spm/Server/UI.hs new file mode 100644 index 00000000..544e4f54 --- /dev/null +++ b/overlays/spm/server/Spm/Server/UI.hs @@ -0,0 +1,23 @@ +{-# LANGUAGE OverloadedStrings, TemplateHaskell #-} + +module Spm.Server.UI + ( uiServer + ) where + +import Prelude + +import Network.Wai + +import Network.Wai.Application.Static +import WaiAppStatic.Types + +import Data.FileEmbed + + +uiServer :: Application +uiServer = staticApp settings + { ssLookupFile = \pcs -> ssLookupFile settings pcs >>= \case + LRNotFound -> ssLookupFile settings [unsafeToPiece "index.html"] + o -> return o + } + where settings = embeddedSettings $(embedDir "frontend") -- cgit v1.2.3