From 3e9704f38e10e06a6863fc0e81bf5c0b34f2bc05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Delano=C3=AB?= <devel+git@delanoe.org> Date: Wed, 7 Mar 2018 16:02:42 +0100 Subject: [PATCH] [ADMIN] better message when starting Gargantext in CL. --- src/Gargantext/API.hs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/Gargantext/API.hs b/src/Gargantext/API.hs index 4749f26..4b7e96d 100644 --- a/src/Gargantext/API.hs +++ b/src/Gargantext/API.hs @@ -175,25 +175,24 @@ swaggerDoc = toSwagger (Proxy :: Proxy GargAPI) swaggerWriteJSON :: IO () swaggerWriteJSON = BL8.writeFile "swagger.json" (encodePretty swaggerDoc) +portRouteInfo :: PortNumber -> IO () +portRouteInfo port = do + print (pack " ----Main Routes----- ") + print ("http://localhost:" <> show port <> "/index.html") + print ("http://localhost:" <> show port <> "/swagger-ui") -- | startGargantext takes as parameters port number and Ini file. startGargantext :: PortNumber -> FilePath -> IO () startGargantext port file = do - print ("Starting Gargantext server" <> show port) - print ("http://localhost:" <> show port) + param <- databaseParameters file conn <- connect param + + portRouteInfo port run port (app conn) startGargantextMock :: PortNumber -> IO () startGargantextMock port = do - print (pack "Starting Mock server") - print (pack $ "curl " - <> "-H \"content-type: application/json" - <> "-d \'{\"query_query\":\"query\"}\' " - <> "-v http://localhost:" - <> show port - <>"/count" - ) + portRouteInfo port run port appMock -- 2.21.0