aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDaniel Schadt <kingdread@gmx.de>2021-06-28 00:05:53 +0200
committerDaniel Schadt <kingdread@gmx.de>2021-06-28 00:05:53 +0200
commit84ca6df46909d39585d96c555b431020f1fbf9c5 (patch)
tree8d4600809c0f1be34fa885b7bd2e793b58bc20ce /app
downloadCana-84ca6df46909d39585d96c555b431020f1fbf9c5.tar.gz
Cana-84ca6df46909d39585d96c555b431020f1fbf9c5.tar.bz2
Cana-84ca6df46909d39585d96c555b431020f1fbf9c5.zip
Initial commit
This is a working version that can serve pages, yay! A lot of features still missing though, as well as proper package metadata.
Diffstat (limited to 'app')
-rw-r--r--app/Main.hs18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/Main.hs b/app/Main.hs
new file mode 100644
index 0000000..000726d
--- /dev/null
+++ b/app/Main.hs
@@ -0,0 +1,18 @@
+{-# LANGUAGE OverloadedStrings #-}
+module Main where
+
+import Cana
+import Cana.Protocol
+import Cana.Router
+
+defaultResponse :: GeminiResponse
+defaultResponse = GeminiResponse
+ { responseStatus = codeSuccess
+ , responseMeta = "text/gemini"
+ , responseData = "# Hello World\nThis page was served by Cana."
+ }
+
+main :: IO ()
+main = runGeminiServer Nothing defaultGeminiPort "certificate.crt" "private.key"
+ [ (anyRoute, const $ return defaultResponse)
+ ]