File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
src/Simplex/Messaging/Server/Web Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,33 @@ module Simplex.Messaging.Server.Web.Embedded where
44
55import Data.ByteString (ByteString )
66import Data.FileEmbed (embedDir , embedFile )
7+ import qualified Language.Haskell.TH.Syntax as TH
8+ import System.FilePath (takeDirectory , (</>) )
79
810indexHtml :: ByteString
9- indexHtml = $ (embedFile " src/Simplex/Messaging/Server/Web/index.html" )
11+ indexHtml =
12+ $ (embedFile =<< do
13+ loc <- TH. location
14+ pure $ takeDirectory (TH. loc_filename loc) </> " index.html"
15+ )
1016
1117linkHtml :: ByteString
12- linkHtml = $ (embedFile " src/Simplex/Messaging/Server/Web/link.html" )
18+ linkHtml =
19+ $ (embedFile =<< do
20+ loc <- TH. location
21+ pure $ takeDirectory (TH. loc_filename loc) </> " link.html"
22+ )
1323
1424mediaContent :: [(FilePath , ByteString )]
15- mediaContent = $ (embedDir " src/Simplex/Messaging/Server/Web/media/" )
25+ mediaContent =
26+ $ (embedDir =<< do
27+ loc <- TH. location
28+ pure $ takeDirectory (TH. loc_filename loc) </> " media"
29+ )
1630
1731wellKnown :: [(FilePath , ByteString )]
18- wellKnown = $ (embedDir " src/Simplex/Messaging/Server/Web/.well-known/" )
32+ wellKnown =
33+ $ (embedDir =<< do
34+ loc <- TH. location
35+ pure $ takeDirectory (TH. loc_filename loc) </> " .well-known"
36+ )
You can’t perform that action at this time.
0 commit comments