Include only nessacary data in webhook

This commit is contained in:
Louis Lam
2022-04-17 19:30:58 +08:00
parent 47c72192e1
commit e6a8a84278
2 changed files with 24 additions and 9 deletions

View File

@@ -11,7 +11,7 @@ if (nodeVersion < requiredVersion) {
}
const args = require("args-parser")(process.argv);
const { sleep, log, getRandomInt, genSecret, debug } = require("../src/util");
const { sleep, log, getRandomInt, genSecret, debug, isDev } = require("../src/util");
const config = require("./config");
log.info("server", "Welcome to Uptime Kuma");
@@ -235,6 +235,13 @@ try {
}
});
if (isDev) {
app.post("/test-webhook", async (request, response) => {
log.debug("test", request.body);
response.send("OK");
});
}
// Robots.txt
app.get("/robots.txt", async (_request, response) => {
let txt = "User-agent: *\nDisallow:";