summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Lib.hs15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Lib.hs b/src/Lib.hs
index 80b927a..13bef06 100644
--- a/src/Lib.hs
+++ b/src/Lib.hs
@@ -178,9 +178,10 @@ instance FromHttpApiData GameState where
Left (_, _, err) -> Left (T.pack err)
Right (_, _, x) -> Right x
-type HomeAPI = Get '[HTML] HomeView
+type HomeAPI = "antiquitysort" :> Get '[HTML] HomeView
type PlayAPI =
+ "antiquitysort" :>
"play"
:> QueryParams "m" MediumTag
:> QueryParams "p" Period
@@ -188,7 +189,9 @@ type PlayAPI =
:> QueryParam "s" GameState
:> Get '[HTML] PlayView
-type API = HomeAPI :<|> PlayAPI :<|> "static" :> Raw
+type StaticAPI = "antiquitysort" :> "static" :> Raw
+
+type API = HomeAPI :<|> PlayAPI :<|> StaticAPI
startApp :: Manifest -> IO ()
startApp manifest = run 8090 (app manifest)
@@ -358,7 +361,7 @@ instance ToHtml HomeView where
where
homeBody = div_ [class_ "narrow"] $ do
p_ $ toHtmlRaw $ T.pack "The spectral sorcerer Roseacrucis has cast his nefarious randomizing algorithms upon the Library&rsquo;s chronicles. Your mission is to restore the well&dash;ordering of our cultural histories."
- form_ [method_ "get", action_ "/play"] $ do
+ form_ [method_ "get", action_ "/antiquitysort/play"] $ do
fieldset_ $ do
legend_ "Folios"
forM_ mediums $ \Medium {tag = (MediumTag tagm), label, description, disabled} -> div_ $ do
@@ -436,7 +439,7 @@ renderWork Work {figures} header = div_ [class_ "work"] $ do
renderFigure :: Monad m => Figure -> HtmlT m ()
renderFigure Figure {file, byline} = figure_ $ do
- img_ [src_ ("/static/assets/" <> file)]
+ img_ [src_ ("/antiquitysort/static/assets/" <> file)]
figcaption_ $ toHtml byline
instance ToHtml PlayView where
@@ -496,8 +499,8 @@ pageTemplate crumbs body = doctypehtml_ $ do
title_ "Antiquitysort"
meta_ [charset_ "utf-8"]
meta_ [name_ "viewport", content_ "width=device-width, initial-scale=1.0"]
- link_ [rel_ "shortcut icon", type_ "image/x-icon", href_ "/static/favicon.ico"]
- link_ [rel_ "stylesheet", type_ "text/css", href_ "/static/style.css"]
+ link_ [rel_ "shortcut icon", type_ "image/x-icon", href_ "/antiquitysort/static/favicon.ico"]
+ link_ [rel_ "stylesheet", type_ "text/css", href_ "/antiquitysort/static/style.css"]
body_ $
div_ [class_ "container"] $ do
div_ [class_ "row navbar"] $