mirror of
https://github.com/zhigang1992/probot.git
synced 2026-06-15 02:18:58 +08:00
17 lines
380 B
JavaScript
17 lines
380 B
JavaScript
const http = require('http');
|
|
|
|
module.exports = function (webhook) {
|
|
return http.createServer((req, res) => {
|
|
webhook(req, res, err => {
|
|
if (err) {
|
|
console.error(err);
|
|
res.statusCode = 500;
|
|
res.end('Something has gone terribly wrong.');
|
|
} else {
|
|
res.statusCode = 404;
|
|
res.end('no such location');
|
|
}
|
|
});
|
|
});
|
|
};
|