forked from chriskinsman/github-action-dashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.js
More file actions
29 lines (25 loc) · 805 Bytes
/
configure.js
File metadata and controls
29 lines (25 loc) · 805 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
const path = require('path');
const runStatus = require('./runstatus');
// Handle when server is started from vue-cli vs root
if (path.basename(process.cwd()) === 'client') {
require('dotenv').config({ path: path.resolve(process.cwd(), '../.env') });
}
else {
require('dotenv').config()
}
const debug = require('debug')('action-dashboard:configure');
//debug(`environment`, process.env);
const bodyParser = require('body-parser')
const routes = require('./routes')
module.exports = {
before: (app) => {
app.use(bodyParser.json());
app.use('/api', routes);
},
after: (app, server) => {
// Attach socket.io to server
runStatus.init(server);
}
}
// Loads webhook support if GITHUB_APP_WEBHOOK_SECRET defined
const webhooks = require('./webhooks');