Configurations
Environment based configuration
Since V4 of SugoiJS, it's allowed to define properties as part of the configuration of application.
The configuration directory found on the root level of the server directory, in the following structure:
- root
- server
- configuration
- default
- security.js
- ssl.js
- variables.js
- <environment>
- security.js
- ssl.js
- variables.js
{
enabled: true,
options: undefined // use helmetjs default configuration, can be replace by:
// more info: https://helmetjs.github.io/docs
// {
// contentSecurityPolicy: {
// directives: {
// defaultSrc: ["'self'"],
// styleSrc: ["'self'", 'maxcdn.bootstrapcdn.com']
// }
// },
// dnsPrefetchControl: true,
// frameguard: true,
// hidePoweredBy: true,
// hpkp: {
// maxAge: 7776000,
// sha256s: ['AbCdEf123=', 'ZyXwVu456=']
// },
// hsts: true,
// ieNoOpen: true,
// noCache: false,
// noSniff: true,
// xssFilter: true,
// expectCt: true
// }
}
Define the path to the ssl certificate files
const path = require('path');
module.exports = null // can be replaced with:
{
cert: path.resolve('pathToCertFile'),
key: path.resolve('pathToKeyFile')
}
Map of environment variables to inject in build time.
access to those environment variable is possible via environment variables
Last modified 4yr ago