mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-07-23 23:11:13 -04:00
implement webhook
This commit is contained in:
parent
d24a15410e
commit
0ad04d1468
6 changed files with 126 additions and 47 deletions
|
@ -12,6 +12,8 @@ const Monitor = require("./model/monitor");
|
|||
const {getSettings} = require("./util-server");
|
||||
const {Notification} = require("./notification")
|
||||
|
||||
app.use(express.json())
|
||||
|
||||
let totalClient = 0;
|
||||
let jwtSecret = null;
|
||||
let monitorList = {};
|
||||
|
@ -27,6 +29,13 @@ let monitorList = {};
|
|||
|
||||
app.use('/', express.static("dist"));
|
||||
|
||||
app.post('/test-webhook', function(request, response, next) {
|
||||
console.log("Test Webhook (application/json only)")
|
||||
console.log("Content-Type: " + request.header("Content-Type"))
|
||||
console.log(request.body)
|
||||
response.end();
|
||||
});
|
||||
|
||||
app.get('*', function(request, response, next) {
|
||||
response.sendFile(process.cwd() + '/dist/index.html');
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue