mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-23 14:54:05 +00:00
WIP
This commit is contained in:
parent
20a68a16f5
commit
21a6b4a131
1 changed files with 4 additions and 4 deletions
|
@ -4,7 +4,7 @@ const { sendInfo } = require("../client");
|
|||
const { checkLogin } = require("../util-server");
|
||||
const GameResolver = require("gamedig/lib/GameResolver");
|
||||
const { testChrome } = require("../monitor-types/real-browser-monitor-type");
|
||||
const fs = require("fs");
|
||||
const fs = require("fs/promises");
|
||||
const path = require("path");
|
||||
|
||||
let gameResolver = new GameResolver();
|
||||
|
@ -85,17 +85,17 @@ module.exports.generalSocketHandler = (socket, server) => {
|
|||
}
|
||||
});
|
||||
|
||||
socket.on("getPushExample", (language, callback) => {
|
||||
socket.on("getPushExample", async (language, callback) => {
|
||||
|
||||
try {
|
||||
let dir = path.join("./extra/push-examples", language);
|
||||
let files = fs.readdirSync(dir);
|
||||
let files = await fs.readdir(dir);
|
||||
|
||||
for (let file of files) {
|
||||
if (file.startsWith("index.")) {
|
||||
callback({
|
||||
ok: true,
|
||||
code: fs.readFileSync(path.join(dir, file), "utf8"),
|
||||
code: await fs.readFile(path.join(dir, file), "utf8"),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue