mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-03-30 20:45:52 +00:00
* web: parameterize generateSite, remove Embedded from library Move embedFile/embedDir out of the library so it works when simplexmq is consumed as a dependency. generateSite now accepts mediaContent, wellKnown, and linkHtml as parameters. * smp-server, xftp-server: embed static files in executables Add shared apps/common/Embedded.hs with TH splices, update SMPWeb and XFTPWeb to pass embedded content to generateSite, move file-embed dependency from library to executables and test suite. * refactor * add export, move common files to Web subfolder * fix .cabal --------- Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
16 lines
510 B
Haskell
16 lines
510 B
Haskell
{-# LANGUAGE TemplateHaskell #-}
|
|
|
|
module Web.Embedded where
|
|
|
|
import Data.FileEmbed (embedDir, embedFile)
|
|
import Simplex.Messaging.Server.Web (EmbeddedContent (..))
|
|
|
|
embeddedContent :: EmbeddedContent
|
|
embeddedContent =
|
|
EmbeddedContent
|
|
{ indexHtml = $(embedFile "apps/common/Web/static/index.html"),
|
|
linkHtml = $(embedFile "apps/common/Web/static/link.html"),
|
|
mediaContent = $(embedDir "apps/common/Web/static/media/"),
|
|
wellKnown = $(embedDir "apps/common/Web/static/.well-known/")
|
|
}
|