diff options
| author | Andrew <saintruler@gmail.com> | 2020-11-27 17:40:04 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2020-11-27 17:40:04 +0400 |
| commit | fb7e450d917ec87202f9de019238b78c1b645328 (patch) | |
| tree | ca70481709864b5c6510009fe45a9d6b6f91dd8c /Main.hs | |
| parent | 039c96096bf8f2294850be79a88a0761a5f58acf (diff) | |
Added basic HTTP types
Diffstat (limited to 'Main.hs')
| -rw-r--r-- | Main.hs | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -1,24 +1,15 @@ module Main where -import System.IO - import Response import Request import Router import Views import Utils +import Http -renderTemplate name = do - template <- readTemplate name - return $ HtmlResponse 200 template - -readTemplate name = do - handle <- openFile ("templates/" ++ name) ReadMode - hGetContents handle - -table = [ Route indexGet "/" "GET" - , Route helloGet "/hello" "GET" ] +table = [ Route indexGet "/" GET + , Route helloGet "/hello" GET ] main = do - response <- resolve table (Request "query" "/jopa" "GET") - print $ getContent response
\ No newline at end of file + response <- resolve table (Request [] "/hello" GET) + print $ response
\ No newline at end of file |