diff options
author | metamuffin <metamuffin@disroot.org> | 2023-10-22 10:40:17 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-10-22 10:40:17 +0200 |
commit | 8103ea89615d5106f13fb45490ea64575f5f9624 (patch) | |
tree | 07a5807f97c8a1d8d421a639e1af67381d76b69c /src/Main.hs | |
parent | ca3f0487b7e866be3dfd80e13be70d8c0891c016 (diff) | |
download | fastbangs-8103ea89615d5106f13fb45490ea64575f5f9624.tar fastbangs-8103ea89615d5106f13fb45490ea64575f5f9624.tar.bz2 fastbangs-8103ea89615d5106f13fb45490ea64575f5f9624.tar.zst |
debugging option to not embed stylesheet and js
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/Main.hs b/src/Main.hs index 03709d4..a59b38a 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -62,12 +62,22 @@ getHomeR = do getBundleR :: Handler TypedContent getBundleR = do cacheSeconds $ 60 * 60 * 24 * 7 - return $ TypedContent typeJavascript $ toContent ($(embedFile "build/bundle.js")) + noEmbed <- confNoEmbed . config <$> getYesod + bundle <- liftIO $ bool + (pure $ toContent ($(embedFile "build/bundle.js"))) + (toContent <$> readFile "../build/bundle.js") + noEmbed + return $ TypedContent typeJavascript bundle getStyleR :: Handler TypedContent getStyleR = do cacheSeconds $ 60 * 60 * 24 * 7 - return $ TypedContent typeCss $ toContent ($(embedFile "build/style.css")) + noEmbed <- confNoEmbed . config <$> getYesod + stylesheet <- liftIO $ bool + (pure $ toContent ($(embedFile "build/style.css"))) + (toContent <$> readFile "../build/style.css") + noEmbed + return $ TypedContent typeCss stylesheet getBangsR :: Handler TypedContent getBangsR = do |