-
Notifications
You must be signed in to change notification settings - Fork 3
Config API
These options can be passed as an object to rupert
, though best practice
for servers is to place them in a dedicated server.json
file. If an option
indicates it can be set from the environment, any environment settings will
override both the default and static configuration.
Recommended. The name of the rupert application. Will use APP_NAME
from the
environment, or 'rupert-app'
as a default.
String. The root of the filesystem for discovering project files. Will use
process.cwd()
as a default.
The plugins
config object allows Rupert to register Plugins to run in both
production and testing (Grunt) environments. Production plugins have access to
the config
object, and are able to add, remove, and edit configuration keys as
necessary to have Rupert perform tailored to a specific task. See [writing a
Rupert plugin][write_plugin] for more.
[write_plugin]:
The plugins.dependencies
object's keys determine plugins to load. Any key
that begins with rupert-config-
, or that is a file path, can be used. See
[writing a custom plugin][write_custom_plugin] for more.
[write_custom_plugin]:
Optional. The hostname to server on. Will use HOST
from the environment, or
os.hostname()
as a default.
Optional. Integer port to listen on. Will use HTTP_PORT
from the environment,
or 8080
as a default.
Optional. Settings for the logger.
String. Suppress warnings below this level. Default 'http'
. Defined levels,
from lowest to highest, are silly
, data
, debug
, verbose
, http
, info
,
warn
, error
, silent
. Will use LOG_LEVEL
from the environment, or
'http'
as a default.
String. Format string for HTTP messages, via morgan. Will use
LOG_FORMAT
from the environment, or 'tiny'
as a default.
String or boolean. Filname to write logging to, in addition to console. If
false
, will not write to a file. Will use LOG_FILE
from the environment, or
false
as a default.
Optional. A configuration for the underlying stassets
compiler. If false
,
completely disables stassets
. For more information, see the stassets
docs.
Recommended. The root directory for stassets
client files, relative to
global.root
specified in the root js file. If an array, specifies the root
directories for a cascading file system. Will use STASSETS_ROOT
from
the environment, or './src/client'
as a default.
Optional. Additional vendor root directories and files. Cookbook: Adding Vendors
Optional. Additional configuration for stassets scripts files.
Optional. An array to fill part of the script lookup glob. Every string in the
types
array is put in a glob like ./src/client/**/*<type>.{js,coffee}
where
./src/client
is the prefix from above, <type>
is the string from this array,
and {js,coffee}
come from the list of available script renderers.
Boolean. Apply a minification step to the finished application.js
content.
Will use COMPRESS_SCRIPTS
from the environment or false
as a default.
(The default value may change in the future, but if the default is true
,
source maps will be correct and valid from the minified output to the original
source code.)
Optional. Array of glob paths. Any file matching that glob will be loaded and
called as a function taking app
, a reference to the application server, and
config
, a reference to this configuration object.
Optional. Object of virtual to logical folder paths. Requests to folders
starting in a key path will be served statically from the logical path. EG, with
images at src/client/assets/img/
, a request for img/nav/logo.png
would need
a configuration like: "static": { "img": "./src/client/assets/img/" }
websockets null false at module.exports (rupert/src/routers.coffee:12:15)
Optional. If present, will configure the server to use SSL encryption for all
connections. If true
, will load TLS using default values.
Optional. Port for HTTPS to listen on. Will use TLS_PORT
from the environment,
or 8443
as a default.
Optional. Path to server private key. Will use TLS_KEY
from the environment,
or "#{global.root}/env/server.key"
as a default.
Optional. Path to server public certificate. Will use TLS_CERT
from the
environment, or "#{global.root}/env/server.crt"
as a default.
If tls
is requested, but either the tls.key
or tls.cert
files are missing,
Rupert will dynamically generate an unsigned certificate for testing.
Certificate is signed for tls.days * 24
hours.
Integer. If Rupert autogenerates a TLS/SSL key, the key will be valid for this
number of days. Will use TLS_DAYS
from the environment, or 1
as a default.
Boolean. If Rupert autogenerates a TLS/SSL key and tls.writeCert
is set,
Rupert will write the certificate to tls.key
and tls.cert
for future use,
including possible signing by a third party. Will use WRITE_CERT
from the
environment, or false
as a default.
String. Path to the main server file in the Rupert application. Will use
APP_SERVER
from the environment, or process.cwd() + "/app.js"
Options to control [jshint][jshint].
[jshint]:
String. Path to a [jshint configuration file][jshrc]. Will use JSHINTRC
from
the environment, or .jshintrc
as a default.
[jshrc]:
Array. File globs to run jshinting on. Always includes [ 'src/**/*.js', 'Gruntfile.js' ]
, and the glob is anchored at the project root.
Options to control [coffeelint][clint]
[clint]:
String. Path to a [coffeelint configuration file][clhrc]. Will use COFFEELINTRC
from the environment, or .coffeelintrc
as a default.
[clhrc]:
Array. File globs to run coffeelinting on. Always includes [ 'src/**/*.coffee', 'Gruntfile.coffee' ]
, and the glob is anchored at the project root.
Configuration settings for client tests.
Root of client globs. Defaults to src/client
.
Additional client files to test. Defaults to ['www/vendors.js', 'www/template.js', 'www/application.js']
.
Array of globs for additional support tools. Includes ['tools/**', '**/*mock.{js,coffee}' ]
and all values are prefixed with client.root
String path from project root to place compiled final files. Uses WRITE_TARGET
from the environment, or ./www
as a default.
List of browsers to run unit tests in. Uses a heuristic to determine one of
PhantomJS
, Chrome
, or Firefox
as a default.
String folder, relative to the project root, to pass as the steps
folder to
CucumberJS. Uses ./src/features/steps
as a default.