summaryrefslogtreecommitdiff
path: root/Run/Que/Website.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Run/Que/Website.hs')
-rw-r--r--Run/Que/Website.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Run/Que/Website.hs b/Run/Que/Website.hs
index e6b458c..8681678 100644
--- a/Run/Que/Website.hs
+++ b/Run/Que/Website.hs
@@ -1,4 +1,5 @@
{-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE LambdaCase #-}
@@ -18,7 +19,7 @@ import qualified System.Exit as Exit
main :: IO ()
main = do
(src, ns) <- Environment.getArgs >>= \case
- [src] -> return (src, "/")
+ [src] -> return (src, "_") -- default to _ ns which is special
[src, ns] -> return (src, ns)
_ -> Exit.die "usage: que-website <srcdir> [namespace]"
@@ -42,14 +43,14 @@ loop ns pages@Sources {..} = do
Async.runConcurrently
$ (,,,)
<$> Async.Concurrently
- (toHtml style index >>= serve (https "que.run" /: ns /: "index.html"))
+ (toHtml style index >>= serve (https "que.run" /: ns /: "index"))
<*> Async.Concurrently
( BS.readFile client
- >>= serve (https "que.run" /: ns /: "_client" /: "python")
+ >>= serve (https "que.run" /: ns /: "client")
)
<*> Async.Concurrently
( toHtml style quescripts
- >>= serve (https "que.run" /: ns /: "_page" /: "quescripts")
+ >>= serve (https "que.run" /: ns /: "quescripts")
)
loop ns pages
@@ -71,6 +72,7 @@ toHtml style md =
]
[]
+-- TODO: recover from 502 errors
serve :: Url scheme -> ByteString -> IO ()
serve path content = runReq defaultHttpConfig $ do
_ <- req POST path (ReqBodyBs content) ignoreResponse mempty