forked from Raashul/CaldwellUniversity-CougarBot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
executable file
·31 lines (21 loc) · 698 Bytes
/
app.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
var express = require('express')
var bodyParser = require('body-parser')
var request = require('request')
let config = require('./config');
var index = require('./src/index');
var app = express()
app.set('port', (process.env.PORT || 5000))
// Process application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({extended: false}))
// Process application/json
app.use(bodyParser.json())
// Index route
app.get('/', function (req, res) {
res.send('Hello world, I am a chat bot')
})
app.get('/webhook/', index.getWebhook);
app.post('/webhook/', index.postWebhook);
// Spin up the server
app.listen(app.get('port'), function() {
console.log('running on port', app.get('port'))
})