Use saltine package

This commit is contained in:
Tissevert 2019-10-13 19:55:35 +02:00
parent b03c7fd087
commit 13cd466e87
2 changed files with 3 additions and 0 deletions

View file

@ -39,6 +39,7 @@ executable hanafudapi
, http-types , http-types
, aeson , aeson
, mtl , mtl
, saltine
, text , text
, vector , vector
, wai , wai

View file

@ -8,6 +8,7 @@ import qualified Config (listenPort)
import Control.Concurrent (newMVar, modifyMVar) import Control.Concurrent (newMVar, modifyMVar)
import Control.Exception (finally) import Control.Exception (finally)
import Control.Monad.Reader (ReaderT(..), asks) import Control.Monad.Reader (ReaderT(..), asks)
import Crypto.Saltine (sodiumInit)
import qualified Hanafuda.Message as Message (FromClient(..)) import qualified Hanafuda.Message as Message (FromClient(..))
import Messaging (broadcast, relay) import Messaging (broadcast, relay)
import Network.HTTP.Types.Status (badRequest400) import Network.HTTP.Types.Status (badRequest400)
@ -36,6 +37,7 @@ serverApp onEnter onExit = do
main :: IO () main :: IO ()
main = do main = do
sodiumInit
app <- serverApp Automaton.start exit app <- serverApp Automaton.start exit
run Config.listenPort $ websocketsOr defaultConnectionOptions app blockNonWS run Config.listenPort $ websocketsOr defaultConnectionOptions app blockNonWS
where where