aboutsummaryrefslogtreecommitdiff
path: root/server/default-conf
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2016-01-24 16:10:48 +0000
committerGregor Kleen <gkleen@yggdrasil.li>2016-01-24 16:10:48 +0000
commitc3a6d0657eb2987aa13b53419269274d848d9e0c (patch)
treefcf161b74fffad2294efc0b558a0dfd1bc27d49b /server/default-conf
parent7d3df6adce65e8840ef651a8a02a34a1a02083aa (diff)
downloadthermoprint-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.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 ]