From b58efa1fc27a377590b7c93c16859da96f6bc244 Mon Sep 17 00:00:00 2001 From: Paul Brinkmeier Date: Fri, 6 Jan 2023 01:41:56 +0100 Subject: [PATCH] Delete old stuff from main --- src/Jon/Main.hs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/Jon/Main.hs b/src/Jon/Main.hs index 8e17d7b..ec03fb3 100644 --- a/src/Jon/Main.hs +++ b/src/Jon/Main.hs @@ -24,7 +24,7 @@ import Jon.Server (JonAPI, jonSwaggerDoc, server) main :: IO () main = withGarfieldConn $ \conn -> - run 8080 $ serve p $ server conn :<|> swaggerSchemaUIServer jonSwaggerDoc :<|> serveDirectoryFileServer "./static" + run 8080 $ serve p (server conn :<|> swaggerSchemaUIServer jonSwaggerDoc :<|> serveDirectoryFileServer "./static") where p :: Proxy (JonAPI :<|> SwaggerSchemaUI "swagger" "swagger.json" :<|> Raw) p = Proxy @@ -34,19 +34,3 @@ withGarfieldConn = bracket (do pass <- getEnv "JON_PASS" connectPostgreSQL $ BS8.pack $ "host=localhost dbname=garfield password=" ++ pass) close - -runQuery - :: (FromBackendRow Postgres (QExprToIdentity e), Projectible Postgres e) - => Q Postgres db QBaseScope e - -> IO [QExprToIdentity e] -runQuery q = withGarfieldConn $ \conn -> runBeamPostgresDebug putStrLn conn $ runSelectReturningList $ select q - -runIns - :: SqlInsert Postgres table - -> IO () -runIns i = withGarfieldConn $ \conn -> runBeamPostgresDebug putStrLn conn $ runInsert i - -runFunction - :: (Connection -> IO a) - -> IO a -runFunction = withGarfieldConn