forked from goeltanmay/SecurityBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
28 lines (24 loc) · 762 Bytes
/
main.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
const express = require('express')
const logger = require('morgan');
const bodyParser = require('body-parser');
// var Repos = require('./db.js');
var app = express()
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ // to support URL-encoded bodies
extended: true
}));
app.use(logger('dev'));
app.set('views', __dirname + '/server/views')
app.set('view engine','pug')
// respond with "hello world" when a GET request is made to the homepage
require('./server/routes')(app);
app.post('*', (req, res) => {
// console.log(req);
// console.log(req.get('X-GitHub-Event'));
res.status(200).send({
message: 'Welcome to the beginning of nothingness.',
});
});
module.exports = app;
var port = process.env.PORT || 3000;
app.listen(port);