Reputation: 3334
I want to close a store connection (adding a function like close eventStoreConnection
) when the process is about to shutdown :
main = do
eventStoreConnection <- EventStore.connect EventStore.defaultSettings (EventStore.Static "127.0.0.1" 1113)
scotty 3000 $ do
get "/health/liveness" $ do html "OK"
post "/introduceIdea" $ do
command <- jsonData
liftIO $ persist eventStoreConnection command
html "OK"
Upvotes: 1
Views: 130