summaryrefslogtreecommitdiff
path: root/bragi/thermoprint-server/thermoprint-server.hs
diff options
context:
space:
mode:
Diffstat (limited to 'bragi/thermoprint-server/thermoprint-server.hs')
-rw-r--r--bragi/thermoprint-server/thermoprint-server.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/bragi/thermoprint-server/thermoprint-server.hs b/bragi/thermoprint-server/thermoprint-server.hs
index 4f909f80..6142e7d9 100644
--- a/bragi/thermoprint-server/thermoprint-server.hs
+++ b/bragi/thermoprint-server/thermoprint-server.hs
@@ -13,12 +13,15 @@ import Control.Monad.Reader
13 13
14import Database.Persist.Postgresql 14import Database.Persist.Postgresql
15 15
16type ServerM = ReaderT ConnectionPool (LoggingT IO)
17
16main :: IO () 18main :: IO ()
17main = thermoprintServer True (Nat runDb) $ (\c -> c { queueManagers = queueManagers }) <$> def `withPrinters` printers 19main = thermoprintServer True (Nat runDb) $ (\c -> c { queueManagers = queueManagers }) <$> def `withPrinters` printers
18 where 20 where
19 runDb :: ReaderT ConnectionPool (LoggingT IO) a -> IO a 21 runDb :: ServerM a -> IO a
20 runDb = runStderrLoggingT . withPostgresqlPool "" 5 . runReaderT 22 runDb = runStderrLoggingT . withPostgresqlPool "" 5 . runReaderT
21 23
24 printers :: [(ResourceT ServerM PrinterMethod, QMConfig (ResourceT ServerM))]
22 printers = [ (pure $ genericPrint "/dev/usb/lp0", def) 25 printers = [ (pure $ genericPrint "/dev/usb/lp0", def)
23 ] 26 ]
24 27