diff --git a/src/LayServer.js b/src/LayServer.js index a945680..14802fe 100644 --- a/src/LayServer.js +++ b/src/LayServer.js @@ -255,7 +255,7 @@ export default class LayServer extends BaseRouter { */ async listen(port = 8080, cb = () => {}) { try { - this.proc = await Bun.serve({ + this.#proc = await Bun.serve({ port, development: Bun.env.BUN_ENV != 'production', fetch: this.handleRequest.bind(this), @@ -269,12 +269,12 @@ export default class LayServer extends BaseRouter { }, }); - if (!this.proc) { + if (!this.#proc) { throw new Error('something went wrong'); } if (!!cb && cb.constructor?.name.endsWith('Function')) { - cb(this.proc); + cb(this.#proc); } } catch (err) { Logger.error('where', err.stack);