summaryrefslogtreecommitdiff
path: root/overlays/spm/server/Spm/Server/UI.hs
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-05-26 13:58:07 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2022-05-26 13:58:07 +0200
commitfc6cf6169868e60c189e4b243330c3717ff159f3 (patch)
tree3f6dea9c1420e23756257b5abea27ec9ed92d58a /overlays/spm/server/Spm/Server/UI.hs
parent84f2affd66a0ff3947b91a30308cb8e6a8ff7594 (diff)
downloadnixos-fc6cf6169868e60c189e4b243330c3717ff159f3.tar
nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.tar.gz
nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.tar.bz2
nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.tar.xz
nixos-fc6cf6169868e60c189e4b243330c3717ff159f3.zip
...
Diffstat (limited to 'overlays/spm/server/Spm/Server/UI.hs')
-rw-r--r--overlays/spm/server/Spm/Server/UI.hs23
1 files changed, 23 insertions, 0 deletions
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 @@
1{-# LANGUAGE OverloadedStrings, TemplateHaskell #-}
2
3module Spm.Server.UI
4 ( uiServer
5 ) where
6
7import Prelude
8
9import Network.Wai
10
11import Network.Wai.Application.Static
12import WaiAppStatic.Types
13
14import Data.FileEmbed
15
16
17uiServer :: Application
18uiServer = staticApp settings
19 { ssLookupFile = \pcs -> ssLookupFile settings pcs >>= \case
20 LRNotFound -> ssLookupFile settings [unsafeToPiece "index.html"]
21 o -> return o
22 }
23 where settings = embeddedSettings $(embedDir "frontend")