From 84ca6df46909d39585d96c555b431020f1fbf9c5 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Mon, 28 Jun 2021 00:05:53 +0200 Subject: 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. --- app/Main.hs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 app/Main.hs (limited to 'app') 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) + ] -- cgit v1.2.3