You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.2 KiB
37 lines
1.2 KiB
'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);
|
|
};
|