forked from digitallyinduced/ihp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.hs
41 lines (31 loc) · 997 Bytes
/
Main.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
module Main where
import IHP.Prelude
import IHP.Environment
import IHP.FrameworkConfig
import qualified IHP.Server
import IHP.RouterSupport
import IHP.ControllerPrelude
import IHP.Mail
--import IHP.GenericController
data DemoController = DemoAction deriving (Eq, Show, Data)
instance AutoRoute DemoController
instance InitControllerContext RootApplication
data WebApplication = WebApplication deriving (Eq, Show)
instance InitControllerContext WebApplication where
initContext = pure ()
instance FrontController WebApplication where
controllers =
[ startPage DemoAction
]
instance FrontController RootApplication where
controllers = [ mountFrontController WebApplication ]
instance Controller DemoController where
action DemoAction = renderPlain "Hello World!"
instance Worker RootApplication where
workers _ = []
config :: ConfigBuilder
config = do
option Development
option $ AppHostname "localhost"
main :: IO ()
main = IHP.Server.run config