diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-20 19:57:15 +0000 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2016-01-20 19:57:15 +0000 |
commit | d27690786ed2056d64c882ac72825755110d4870 (patch) | |
tree | 513f2fda510e38e1a1c9bd90dd43bdba7f83bfea /server/default-conf | |
parent | 47e346cdea8fdb158cd2942c614609c041936c9e (diff) | |
download | thermoprint-d27690786ed2056d64c882ac72825755110d4870.tar thermoprint-d27690786ed2056d64c882ac72825755110d4870.tar.gz thermoprint-d27690786ed2056d64c882ac72825755110d4870.tar.bz2 thermoprint-d27690786ed2056d64c882ac72825755110d4870.tar.xz thermoprint-d27690786ed2056d64c882ac72825755110d4870.zip |
Nonfunctional API framework for server
Diffstat (limited to 'server/default-conf')
-rw-r--r-- | server/default-conf/Main.hs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/server/default-conf/Main.hs b/server/default-conf/Main.hs new file mode 100644 index 0000000..0aa7d91 --- /dev/null +++ b/server/default-conf/Main.hs | |||
@@ -0,0 +1,17 @@ | |||
1 | {-# LANGUAGE OverloadedStrings #-} | ||
2 | |||
3 | module Main (main) where | ||
4 | |||
5 | import Thermoprint.Server | ||
6 | |||
7 | import Control.Monad.Trans.Resource | ||
8 | import Control.Monad.Logger | ||
9 | import Control.Monad.Reader | ||
10 | |||
11 | import Database.Persist.Sqlite | ||
12 | |||
13 | main :: IO () | ||
14 | main = thermoprintServer (Nat runSqlite) def | ||
15 | where | ||
16 | runSqlite :: ReaderT ConnectionPool (LoggingT (ResourceT IO)) a -> IO a | ||
17 | runSqlite = runResourceT . runStderrLoggingT . withSqlitePool ":memory:" 1 . runReaderT | ||