From 13cd466e871fb98b472cbec0375acf9460c4a1f4 Mon Sep 17 00:00:00 2001 From: Tissevert Date: Sun, 13 Oct 2019 19:55:35 +0200 Subject: [PATCH] Use saltine package --- hanafuda-webapp.cabal | 1 + src/Main.hs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/hanafuda-webapp.cabal b/hanafuda-webapp.cabal index e23e969..83ebb14 100644 --- a/hanafuda-webapp.cabal +++ b/hanafuda-webapp.cabal @@ -39,6 +39,7 @@ executable hanafudapi , http-types , aeson , mtl + , saltine , text , vector , wai diff --git a/src/Main.hs b/src/Main.hs index 2b91341..c99dd25 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -8,6 +8,7 @@ import qualified Config (listenPort) import Control.Concurrent (newMVar, modifyMVar) import Control.Exception (finally) import Control.Monad.Reader (ReaderT(..), asks) +import Crypto.Saltine (sodiumInit) import qualified Hanafuda.Message as Message (FromClient(..)) import Messaging (broadcast, relay) import Network.HTTP.Types.Status (badRequest400) @@ -36,6 +37,7 @@ serverApp onEnter onExit = do main :: IO () main = do + sodiumInit app <- serverApp Automaton.start exit run Config.listenPort $ websocketsOr defaultConnectionOptions app blockNonWS where