-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathserver.js
More file actions
31 lines (28 loc) · 767 Bytes
/
server.js
File metadata and controls
31 lines (28 loc) · 767 Bytes
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 IndexLib = require('./lib/index')
var express = require('express')
var bodyParser = require('body-parser');
var app = express()
var Config = require('./config.json')
/*
{
"http": {
"port": 80
},
"memegenerator": {
"username": "",
"password": "",
"baseUrl": "http://version1.api.memegenerator.net"
},
"slack": {
"token": "",
"webhook": "https://hooks.slack.com/services/..."
}
}
*/
app.use(bodyParser.json()); // for parsing application/json
app.use(bodyParser.urlencoded({ extended: true })); // for parsing application/x-www-form-urlencoded
app.set('port', Config.http.port)
var lib = new IndexLib(Config, app)
var server = app.listen(app.get('port'), function() {
console.log('Express server listening on port ' + server.address().port)
})