summaryrefslogtreecommitdiff
path: root/Main.hs
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2020-11-27 17:40:04 +0400
committerAndrew <saintruler@gmail.com>2020-11-27 17:40:04 +0400
commitfb7e450d917ec87202f9de019238b78c1b645328 (patch)
treeca70481709864b5c6510009fe45a9d6b6f91dd8c /Main.hs
parent039c96096bf8f2294850be79a88a0761a5f58acf (diff)
Added basic HTTP types
Diffstat (limited to 'Main.hs')
-rw-r--r--Main.hs19
1 files changed, 5 insertions, 14 deletions
diff --git a/Main.hs b/Main.hs
index b2c6de1..ced8f22 100644
--- a/Main.hs
+++ b/Main.hs
@@ -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