Commit 1622dcfa authored by Alexandre Delanoë's avatar Alexandre Delanoë

[FIX] adding port number as parameter when starting the server.

parent 16152799
......@@ -11,6 +11,7 @@ sudo apt-get install libbz2-dev lipq-dev
# Starting
stack ghci
startGargantext "gargantext.ini"
startGargantext 8008 "gargantext.ini"
......@@ -4,10 +4,10 @@ module Main where
import Gargantext.Prelude
import Gargantext.Server (startGargantext)
import Text.Read (read)
import System.Environment (getArgs)
main :: IO ()
main = do
(iniFile:_) <- getArgs
startGargantext iniFile
(port:iniFile:_) <- getArgs
startGargantext (read port :: Int) iniFile
......@@ -60,16 +60,14 @@ server conn
where
echo s = pure s
startGargantext :: FilePath -> IO ()
startGargantext file = do
startGargantext :: Int -> FilePath -> IO ()
startGargantext port file = do
print ("Starting server on port " <> show port)
param <- databaseParameters file
conn <- connect param
run port $ app conn
where
port = 8008
-- | TODO App type, the main monad in which the bot code is written with.
-- Provide config, state, logs and IO
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment