-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated to kth-node-configuration@1.3.1 = DOCKER READY + simplified s…
…ettings
- Loading branch information
Showing
16 changed files
with
85 additions
and
128 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** | ||
* | ||
* Server specific settings | ||
* | ||
* ************************************************* | ||
* * WARNING! Secrets should be read from env-vars * | ||
* ************************************************* | ||
* | ||
*/ | ||
const { getEnv, unpackMongodbConfig } = require('kth-node-configuration') | ||
const { safeGet } = require('safe-utils') | ||
|
||
// DEFAULT SETTINGS used for dev, if you want to override these for you local environment, use env-vars in .env | ||
const devPrefixPath = '/api/node' | ||
const devSsl = false | ||
const devPort = 3001 | ||
const devMongodb = 'mongodb://localhost:27017/node' | ||
// END DEFAULT SETTINGS | ||
|
||
module.exports = { | ||
// The proxy prefix path if the application is proxied. E.g /places | ||
proxyPrefixPath: { | ||
uri: getEnv('SERVICE_PUBLISH', devPrefixPath) | ||
}, | ||
useSsl: safeGet(() => getEnv('SERVER_SSL', devSsl + '').toLowerCase() == 'true'), | ||
port: getEnv('SERVER_PORT', devPort), | ||
|
||
ssl: { | ||
// In development we don't have SSL feature enabled | ||
pfx: getEnv('SERVER_CERT_FILE', ''), | ||
passphrase: getEnv('SERVER_CERT_PASSPHRASE', '') | ||
}, | ||
|
||
// API keys | ||
api_keys: [{ | ||
name: 'devClient', | ||
apikey: getEnv('NODE_API_KEY', '1234'), | ||
scope: ['write', 'read'] | ||
}], | ||
|
||
// Services | ||
db: unpackMongodbConfig('MONGODB_URI', devMongodb), | ||
|
||
// Logging | ||
logging: { | ||
log: { | ||
level: getEnv('LOGGING_LEVEL', 'debug') | ||
} | ||
} | ||
|
||
// Custom app settings | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,9 @@ | ||
'use strict' | ||
const { generateConfig } = require('kth-node-configuration') | ||
|
||
const configurator = require('kth-node-configuration') | ||
// These settings are used by the server | ||
const serverConfig = generateConfig([ | ||
require('../../../config/serverSettings') | ||
]) | ||
|
||
const config = configurator({ | ||
defaults: require('../../../config/commonSettings'), | ||
local: require('../../../config/localSettings'), | ||
ref: require('../../../config/refSettings'), | ||
prod: require('../../../config/prodSettings'), | ||
dev: require('../../../config/devSettings') | ||
}) | ||
|
||
module.exports = { | ||
full: config.full(), | ||
secure: config.secure(), | ||
safe: config.safe(), | ||
env: config.env() | ||
} | ||
module.exports.server = serverConfig |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
'use strict' | ||
|
||
const accessLog = require('kth-node-access-log') | ||
const config = require('../configuration').full | ||
const config = require('../configuration').server | ||
const server = require('../../server') | ||
|
||
server.use(accessLog(config.logging.accessLog)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters