diff options
| author | Andrew <saintruler@gmail.com> | 2020-11-27 20:51:21 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2020-11-27 20:51:21 +0400 |
| commit | 46d7f5d2d88a62ed2c77514c33d97e25d737881c (patch) | |
| tree | c79a0c9ab4a1094b04716320d1c686bbe2a73eb7 /Web/Views.hs | |
| parent | 0093cbc556c735d148b571011a45ad32c567d62d (diff) | |
Added networking
Diffstat (limited to 'Web/Views.hs')
| -rw-r--r-- | Web/Views.hs | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/Web/Views.hs b/Web/Views.hs deleted file mode 100644 index 6619d09..0000000 --- a/Web/Views.hs +++ /dev/null @@ -1,25 +0,0 @@ -module Web.Views where - -import System.IO -import qualified Data.Text as T -import Data.Text (Text) - -import Web.Request -import Web.Response - -indexGet (Request query url method) = - return $ HtmlResponse 200 (T.pack "<strong>index</strong>") - -helloGet req = - return $ HtmlResponse 200 (T.pack "<i>hello</i>") - -renderTemplate :: String -> IO Response -renderTemplate name = do - template <- readTemplate name - return $ HtmlResponse 200 template - -readTemplate :: String -> IO Text -readTemplate name = do - handle <- openFile ("templates/" ++ name) ReadMode - contents <- hGetContents handle - return $ T.pack contents |