From 32ec9fa454e1d6a670d8b7fe193458d59b62ca63 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 23 Jul 2021 23:38:35 +0100 Subject: (Server)+index.html landing page with support in app --- Server/Main.hs | 8 +++++++- Server/pages/index.html | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 Server/pages/index.html (limited to 'Server') diff --git a/Server/Main.hs b/Server/Main.hs index bed3de5..8954d6d 100644 --- a/Server/Main.hs +++ b/Server/Main.hs @@ -2,6 +2,7 @@ module Main where import Data.List +import Data.ByteString.Lazy (fromStrict) import Text.Printf import Network.Wai import Network.HTTP.Types @@ -15,6 +16,11 @@ app request respond = respond $ index :: Response index = + responseFile status200 + [("Content-Type", "text/html;charset=UTF-8")] + "pages/index.html" + Nothing + responseLBS status200 [("Content-Type", "text/plain")] "Hello, world!" @@ -22,7 +28,7 @@ index = errorResponse :: Response errorResponse = responseFile status200 - [("Content-Type", "text/plain")] + [("Content-Type", "text/html;charset=UTF-8")] "pages/error.html" Nothing diff --git a/Server/pages/index.html b/Server/pages/index.html new file mode 100644 index 0000000..0358ac6 --- /dev/null +++ b/Server/pages/index.html @@ -0,0 +1,35 @@ + + + + + + NumberDisplay - Error + + + + + + + + + + + +
+ + +
+ + -- cgit v1.2.3-13-gbd6f