diff options
author | EuAndreh <eu@euandre.org> | 2024-03-17 14:18:16 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2024-03-17 14:18:16 -0300 |
commit | 35f8f325e36c114fd2a8fdc70356342fbc08f3ca (patch) | |
tree | de6337b846cc5d4129d760b757a8e927296676ff /src/web.mjs | |
parent | src/hero.mjs: Include "timestamp" in the logged data objects (diff) | |
download | papod-35f8f325e36c114fd2a8fdc70356342fbc08f3ca.tar.gz papod-35f8f325e36c114fd2a8fdc70356342fbc08f3ca.tar.xz |
src/web.mjs: Move the "starting-server" logging into hero when .listen()
Diffstat (limited to 'src/web.mjs')
-rw-r--r-- | src/web.mjs | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/web.mjs b/src/web.mjs index 5128a1e..b13640b 100644 --- a/src/web.mjs +++ b/src/web.mjs @@ -5,7 +5,7 @@ import * as hero from "./hero.mjs"; const name = "papo"; const newConnection = (req, ws) => { - // console.log({ ws, req }); + console.log({ ws, req }); // ws.on("error", console.error); // ws.on("message", x => console.log(x.toString())); // ws.send("hello from the server"); @@ -15,18 +15,10 @@ const routes = [ [ "WEBSOCKET", "/api/socket", newConnection ], ]; -export const app = async (socket, pipe) => { - const server = hero.buildServer({ +export const app = async (socket, pipe) => + await hero.buildServer({ name, routes, socket, pipe, - }); - await server.start(); - hero.log.info({ - type: "starting-server", - name, - socket, - pipe, - }); -}; + }).start(); |