aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-06-29 00:08:09 +0200
committerDaniel Schadt <kingdread@gmx.de>2021-06-29 00:08:09 +0200
commitdce5159d2a7c8d2043a9686cbeca76fec69fac87 (patch)
tree1afb5672902c8ba20b07e23ff56b0a45915d6359 /app
parent84ca6df46909d39585d96c555b431020f1fbf9c5 (diff)
downloadCana-dce5159d2a7c8d2043a9686cbeca76fec69fac87.tar.gz
Cana-dce5159d2a7c8d2043a9686cbeca76fec69fac87.tar.bz2
Cana-dce5159d2a7c8d2043a9686cbeca76fec69fac87.zip
Add static file server
Some simple code that allows Cana to serve files from a directory, and not just provide static responses.
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/Main.hs b/app/Main.hs
index 000726d..50ca151 100644
--- a/app/Main.hs
+++ b/app/Main.hs
@@ -4,6 +4,7 @@ module Main where
import Cana
import Cana.Protocol
import Cana.Router
+import Cana.Extra
defaultResponse :: GeminiResponse
defaultResponse = GeminiResponse
@@ -14,5 +15,5 @@ defaultResponse = GeminiResponse
main :: IO ()
main = runGeminiServer Nothing defaultGeminiPort "certificate.crt" "private.key"
- [ (anyRoute, const $ return defaultResponse)
+ [ (anyRoute, staticFiles "gmdocs")
]