-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathserver-options.js
More file actions
36 lines (33 loc) · 1.24 KB
/
server-options.js
File metadata and controls
36 lines (33 loc) · 1.24 KB
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
35
36
'use strict';
const Logger = require('./utils/logger');
const logger = new Logger();
module.exports = function getServerOptions () {
const defaults = {
routes: {
// Each entry corresponds with an express' router.
// You must define at least one path. However, middlewares are optional.
api: [{
// Required: path where other "routers" or "controllers" will be attached to.
paths: [
// In case the path has a :user param the username will be the one specified in the URL,
// otherwise it will fallback to extract the username from the host header.
'/api/:version',
'/user/:user/api/:version'
],
// Optional: attach middlewares at the begining of the router
// to perform custom operations.
middlewares: [],
sql: [{
// Required
paths: [
'/sql'
],
// Optional
middlewares: []
}]
}]
},
logger
};
return Object.assign({}, defaults, global.settings);
};