forked from Toroid-io/wekan-gogs
-
Notifications
You must be signed in to change notification settings - Fork 3
/
server.js
40 lines (31 loc) · 929 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
var express = require('express')
, morgan = require('morgan')
, bodyParser = require('body-parser');
var run = function(w2g) {
const port = 7654;
var app = express();
app.use(morgan('dev')); //Logging
app.use(bodyParser.json());
app.post('/gogs/priority', function (req, res) {
w2g.gogs.parseHookPrio(req.body);
res.status(200).send('OK');
});
app.post('/gogs', function (req, res) {
w2g.gogs.parseHook(req.body);
res.status(200).send('OK');
});
app.post('/wekan/priority', function (req, res) {
w2g.wekan.parseHook(req.body, true);
res.status(200).send('OK');
});
app.post('/wekan', function (req, res) {
w2g.wekan.parseHook(req.body, false);
res.status(200).send('OK');
});
app.listen(port, function() {
console.log('Listening on port '+port);
});
};
module.exports = {
run: run
};