summaryrefslogtreecommitdiff
path: root/Omni/Ava/Web.hs
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-19 22:31:48 -0500
committerBen Sima <ben@bensima.com>2025-12-19 22:31:48 -0500
commit9da36431a548fbbd00939b46792828ce5367cfe6 (patch)
treea2bd6579040f50fc802fe1d3a6068aa403363e91 /Omni/Ava/Web.hs
parent43e2512d3ca1311cd7019148e9cf417a8feab068 (diff)
fix(ava): initialize tool_traces table on web server startup
The table creation was in Memory.initMemoryDb but Web.hs opened the database directly without calling it. Now Trace.hs has its own initTraceDb function that Web.startWebServer calls on startup.
Diffstat (limited to 'Omni/Ava/Web.hs')
-rw-r--r--Omni/Ava/Web.hs5
1 files changed, 5 insertions, 0 deletions
diff --git a/Omni/Ava/Web.hs b/Omni/Ava/Web.hs
index 86a8280..4d4ece6 100644
--- a/Omni/Ava/Web.hs
+++ b/Omni/Ava/Web.hs
@@ -17,6 +17,7 @@ module Omni.Ava.Web
( startWebServer,
app,
defaultPort,
+ main,
)
where
@@ -33,12 +34,16 @@ import qualified Network.Wai.Handler.Warp as Warp
import qualified Omni.Ava.Trace as Trace
import qualified System.Environment as Environment
+main :: IO ()
+main = putText "Use Omni.Ava for the main entry point"
+
defaultPort :: Int
defaultPort = 8079
startWebServer :: Int -> FilePath -> IO ()
startWebServer port dbPath = do
putText <| "Starting Ava web server on port " <> tshow port
+ SQL.withConnection dbPath Trace.initTraceDb
Warp.run port (app dbPath)
app :: FilePath -> Wai.Application