diff options
Diffstat (limited to 'server/default-conf')
| -rw-r--r-- | server/default-conf/Main.hs | 14 |
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 | ||
| 3 | module Main (main) where | 4 | module Main (main) where |
| 4 | 5 | ||
| 5 | import Thermoprint.Server | 6 | import Thermoprint.Server |
| 6 | 7 | ||
| 8 | import Thermoprint.Server.Printer.Debug | ||
| 9 | |||
| 7 | import Control.Monad.Trans.Resource | 10 | import Control.Monad.Trans.Resource |
| 8 | import Control.Monad.Logger | 11 | import Control.Monad.Logger |
| 9 | import Control.Monad.Reader | 12 | import Control.Monad.Reader |
| @@ -11,7 +14,10 @@ import Control.Monad.Reader | |||
| 11 | import Database.Persist.Sqlite | 14 | import Database.Persist.Sqlite |
| 12 | 15 | ||
| 13 | main :: IO () | 16 | main :: IO () |
| 14 | main = thermoprintServer (Nat runSqlite) def | 17 | main = 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 | ] | ||
