-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.hs
More file actions
27 lines (23 loc) · 857 Bytes
/
Main.hs
File metadata and controls
27 lines (23 loc) · 857 Bytes
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
{-# LANGUAGE OverloadedStrings, QuasiQuotes,
TemplateHaskell #-}
import Application () -- for YesodDispatch instance
import Foundation
import Yesod.Core
import Yesod.Static
import Network.HTTP.Client.Conduit
import Control.Monad.Logger (runStdoutLoggingT)
import Database.Persist.Postgresql
connStr :: ConnectionString
connStr = "dbname=d8h79a3ju7m2i2 host=ec2-107-21-109-15.compute-1.amazonaws.com user=bdtiqjhebmkuhm password=2dad2bddfc9f7b7d4d29b7cf08710dabf09c1f2fa57ad515b39a6c3af729354b port=5432"
main :: IO ()
main = do
man <- newManager
runStdoutLoggingT $ withPostgresqlPool connStr 10 $ \pool -> liftIO $ do
runSqlPersistMPool (runMigration migrateAll) pool
static@(Static settings) <- static "static"
warp 8080 (App static pool man)
{-
do
static@(Static settings) <- static "static"
warp 8080 (App static)
-}