Skip to content

Commit

Permalink
[ server ] Changed default mode as socket mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffcysu committed Nov 13, 2022
1 parent 9c17790 commit eb95434
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@ run devMode = do
_ <- runServerWithHandles handle handle (serverDefn env)
putStrLn "== dev server closed =="
else do
runServer (serverDefn env)
-- runServer (serverDefn env)
let port = "3000"
putStrLn "== GCL backend program started =="
_ <- forkIO (printLog env)
serve (Host "127.0.0.1") port $ \(sock, _remoteAddr) -> do
putStrLn $ "== GCL language server established at port:" ++ port ++ " =="
handle <- socketToHandle sock ReadWriteMode
_ <- runServerWithHandles handle handle (serverDefn env)
putStrLn "== GCL language server closed =="
where
printLog :: GlobalEnv -> IO ()
printLog env = forever $ do
Expand Down

0 comments on commit eb95434

Please sign in to comment.