diff options
| author | Andrew <saintruler@gmail.com> | 2020-11-27 17:50:54 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2020-11-27 17:50:54 +0400 |
| commit | 1cc6cfef971ccb3c1d70f2a5570e445556e4f6fb (patch) | |
| tree | 4773f8178225068e19bd7418622f8dd9084543ac /Web/Views.hs | |
| parent | fb7e450d917ec87202f9de019238b78c1b645328 (diff) | |
Changed directory structure
Diffstat (limited to 'Web/Views.hs')
| -rw-r--r-- | Web/Views.hs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Web/Views.hs b/Web/Views.hs new file mode 100644 index 0000000..b6ae013 --- /dev/null +++ b/Web/Views.hs @@ -0,0 +1,20 @@ +module Web.Views where + +import System.IO + +import Web.Request +import Web.Response + +indexGet (Request query url method) = + return $ HtmlResponse 200 "<strong>index</strong>" + +helloGet req = + return $ HtmlResponse 200 "<i>hello</i>" + +renderTemplate name = do + template <- readTemplate name + return $ HtmlResponse 200 template + +readTemplate name = do + handle <- openFile ("templates/" ++ name) ReadMode + hGetContents handle
\ No newline at end of file |