upd
This commit is contained in:
+17
-6
@@ -127,14 +127,16 @@ app.get("/start", async (req, res) => {
|
||||
type,
|
||||
buildName,
|
||||
ownerIp,
|
||||
hostname: sessionServer.hostname,
|
||||
localIP: sessionServer.localIP,
|
||||
});
|
||||
}
|
||||
|
||||
return res.json({ stream: result.id });
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
return res.json({ error: error.message });
|
||||
}
|
||||
console.log("error", error);
|
||||
continue;
|
||||
// return res.json({ error: (error as Error).message });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,6 +204,17 @@ app.get("/session_servers", async (req, res) => {
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/launch_logs", async (req, res) => {
|
||||
try {
|
||||
const result = await LaunchLog.find().limit(200);
|
||||
res.json(result);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
res.json({ error: error.message });
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
app.listen(port, () => {
|
||||
console.log(`Server is listening on port ${port}`);
|
||||
});
|
||||
@@ -227,9 +240,7 @@ async function checkActiveSessions() {
|
||||
|
||||
console.log("Result:", result);
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
console.log({ error });
|
||||
}
|
||||
console.log({ error });
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,14 @@ const launchLogSchema = new Schema(
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
hostname: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
localIP: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
timestamps: true,
|
||||
|
||||
Reference in New Issue
Block a user