-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMain.hs
36 lines (28 loc) · 834 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
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# OPTIONS_GHC -fno-warn-unused-top-binds #-}
module Main
( main
) where
import Network.Wai.Handler.Warp (run)
import Rollbar.Client
import Rollbar.Yesod (rollbarYesodMiddleware)
import Yesod.Core
newtype App = App { appRollbarSettings :: Settings }
mkYesod "App" [parseRoutes|
/ RootR GET
|]
instance HasSettings Handler where
getSettings = getsYesod appRollbarSettings
instance Yesod App where
yesodMiddleware = rollbarYesodMiddleware . defaultYesodMiddleware
getRootR :: Handler ()
getRootR = error "yesod"
main :: IO ()
main = do
settings <- readSettings "rollbar.yaml"
toWaiApp (App settings) >>= run 3000