forked from WeAllJS/wheelie-slack-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver.js
34 lines (28 loc) · 799 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
const restify = require('restify')
const command = require('./lib/res/command')
const install = require('./lib/res/install')
const button = require('./lib/res/button')
const signup = require('./lib/res/signup')
const event = require('./lib/res/event')
const oauth = require('./lib/res/oauth')
const installInviter = require('./lib/res/install-inviter')
require('./lib/bot').listen()
const server = restify.createServer()
const scopes = [
'incoming-webhook',
'commands',
'bot',
'chat:write:user'
]
server.use(restify.bodyParser())
const resources = [
command('/command'),
install('/install', scopes),
button('/button'),
signup('/signup'),
event('/event'),
oauth('/oauth'),
installInviter('/install-inviter')
]
resources.map(r => r(server))
server.listen(process.env.PORT)