diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-24 16:10:48 +0000 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-24 16:10:48 +0000 |
| commit | c3a6d0657eb2987aa13b53419269274d848d9e0c (patch) | |
| tree | fcf161b74fffad2294efc0b558a0dfd1bc27d49b /server/default-conf | |
| parent | 7d3df6adce65e8840ef651a8a02a34a1a02083aa (diff) | |
| download | thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.tar thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.tar.gz thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.tar.bz2 thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.tar.xz thermoprint-c3a6d0657eb2987aa13b53419269274d848d9e0c.zip | |
Working printer config & debug printer
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 | ] | ||
