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 ...@@ -11,6 +11,7 @@ sudo apt-get install libbz2-dev lipq-dev
# Starting # Starting
stack ghci stack ghci
startGargantext "gargantext.ini"
startGargantext 8008 "gargantext.ini"
...@@ -4,10 +4,10 @@ module Main where ...@@ -4,10 +4,10 @@ module Main where
import Gargantext.Prelude import Gargantext.Prelude
import Gargantext.Server (startGargantext) import Gargantext.Server (startGargantext)
import Text.Read (read)
import System.Environment (getArgs) import System.Environment (getArgs)
main :: IO () main :: IO ()
main = do main = do
(iniFile:_) <- getArgs (port:iniFile:_) <- getArgs
startGargantext iniFile startGargantext (read port :: Int) iniFile
...@@ -60,16 +60,14 @@ server conn ...@@ -60,16 +60,14 @@ server conn
where where
echo s = pure s echo s = pure s
startGargantext :: FilePath -> IO () startGargantext :: Int -> FilePath -> IO ()
startGargantext file = do startGargantext port file = do
print ("Starting server on port " <> show port) print ("Starting server on port " <> show port)
param <- databaseParameters file param <- databaseParameters file
conn <- connect param conn <- connect param
run port $ app conn run port $ app conn
where
port = 8008
-- | TODO App type, the main monad in which the bot code is written with. -- | TODO App type, the main monad in which the bot code is written with.
-- Provide config, state, logs and IO -- 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