fix(LayServer) private variable typo

This commit is contained in:
gh0sTedBuddy
2024-04-02 02:47:52 +01:00
parent ecff79b5f2
commit e4508620d0

View File

@@ -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);