This commit is contained in:
David Négrier 2021-12-06 18:34:09 +01:00
parent 84f7a8c383
commit b9840cfa3d

View File

@ -23,7 +23,9 @@ export class DebugController {
.writeStatus("200 OK") .writeStatus("200 OK")
.writeHeader("Content-Type", "application/json") .writeHeader("Content-Type", "application/json")
.end( .end(
stringify(await Promise.all(socketManager.getWorlds().values()), (key: unknown, value: unknown) => { stringify(
await Promise.all(socketManager.getWorlds().values()),
(key: unknown, value: unknown) => {
if (key === "listeners") { if (key === "listeners") {
return "Listeners"; return "Listeners";
} }
@ -48,10 +50,10 @@ export class DebugController {
} else { } else {
return value; return value;
} }
}) }
)
); );
})().catch((e) => {
})().catch(e => {
console.error(e); console.error(e);
res.writeStatus("500"); res.writeStatus("500");
res.end("An error occurred"); res.end("An error occurred");