aboutsummaryrefslogtreecommitdiff
path: root/server/default-conf
diff options
context:
space:
mode:
Diffstat (limited to 'server/default-conf')
-rw-r--r--server/default-conf/Main.hs14
1 files changed, 10 insertions, 4 deletions
diff --git a/server/default-conf/Main.hs b/server/default-conf/Main.hs
index 0aa7d91..0fba774 100644
--- a/server/default-conf/Main.hs
+++ b/server/default-conf/Main.hs
@@ -1,9 +1,12 @@
1{-# LANGUAGE OverloadedStrings #-} 1{-# LANGUAGE OverloadedStrings #-}
2{-# LANGUAGE ImpredicativeTypes #-}
2 3
3module Main (main) where 4module Main (main) where
4 5
5import Thermoprint.Server 6import Thermoprint.Server
6 7
8import Thermoprint.Server.Printer.Debug
9
7import Control.Monad.Trans.Resource 10import Control.Monad.Trans.Resource
8import Control.Monad.Logger 11import Control.Monad.Logger
9import Control.Monad.Reader 12import Control.Monad.Reader
@@ -11,7 +14,10 @@ import Control.Monad.Reader
11import Database.Persist.Sqlite 14import Database.Persist.Sqlite
12 15
13main :: IO () 16main :: IO ()
14main = thermoprintServer (Nat runSqlite) def 17main = thermoprintServer (Nat runSqlite) $ def `withPrinters` printers
15 where 18 where
16 runSqlite :: ReaderT ConnectionPool (LoggingT (ResourceT IO)) a -> IO a 19 runSqlite :: ReaderT ConnectionPool (LoggingT IO) a -> IO a
17 runSqlite = runResourceT . runStderrLoggingT . withSqlitePool ":memory:" 1 . runReaderT 20 runSqlite = runStderrLoggingT . withSqlitePool ":memory:" 1 . runReaderT
21
22 printers = [ PS Debug
23 ]