Skip to content

Commit

Permalink
[ui] Start Web UI after the proxy is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyash-b committed Mar 3, 2024
1 parent 3089a9b commit 8078dc7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/shell.ngs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ F '$()'(cp:CommandsPipeline) {
guard false
}

PROXY_DIR = Dir(".." / "ngs-web-ui-proxy").assert()

WEB_SERVER_DIR = Dir(".." / "ngs-web-ui").assert()
ENV.BROWSER = 'none'
web_server = $(cd:WEB_SERVER_DIR npm start &)
echo("Web server PID: ${web_server.processes[0].pid}")

PROXY_DIR = Dir(".." / "ngs-web-ui-proxy").assert()

# Hack - names, because parameters' types can only be identifiers
ServerHandler = net::ServerHandler
Expand All @@ -23,7 +22,9 @@ F on_listen(sh:ServerHandler, s:Server) {
super(sh, s)
p = $(x_top_level:: cd:PROXY_DIR npx ts-node src/server.ts ../ngs/ngs-shell.sock &)
echo("Proxy PID: ${p.processes[0].pid}")
# TODO: open the web app

web_server = $(cd:WEB_SERVER_DIR npm start &)
echo("Web server PID: ${web_server.processes[0].pid}")
}

net::unix_json_rpc_server("ngs-shell.sock", ns {
Expand Down

0 comments on commit 8078dc7

Please sign in to comment.