Skip to content
David Souther edited this page Jan 8, 2015 · 7 revisions

Rupert Production Configuration

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.

name

Recommended. The name of the rupert application. Will use APP_NAME from the environment, or 'rupert-app' as a default.

root

String. The root of the filesystem for discovering project files. Will use process.cwd() as a default.

plugins

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]:

plugins.dependencies

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]:

hostname

Optional. The hostname to server on. Will use HOST from the environment, or os.hostname() as a default.

port

Optional. Integer port to listen on. Will use HTTP_PORT from the environment, or 8080 as a default.

log

Optional. Settings for the logger.

log.level

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.

log.format

String. Format string for HTTP messages, via morgan. Will use LOG_FORMAT from the environment, or 'tiny' as a default.

log.file

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.

stassets

Optional. A configuration for the underlying stassets compiler. If false, completely disables stassets. For more information, see the stassets docs.

stassets.root

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.

stassets.vendors

Optional. Additional vendor root directories and files. Cookbook: Adding Vendors

stassets.scripts

Optional. Additional configuration for stassets scripts files.

stassets.scripts.types

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.

stassets.scripts.compress

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.)

routing

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.

static

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)

tls

Optional. If present, will configure the server to use SSL encryption for all connections. If true, will load TLS using default values.

tls.port

Optional. Port for HTTPS to listen on. Will use TLS_PORT from the environment, or 8443 as a default.

tls.key

Optional. Path to server private key. Will use TLS_KEY from the environment, or "#{global.root}/env/server.key" as a default.

tls.cert

Optional. Path to server public certificate. Will use TLS_CERT from the environment, or "#{global.root}/env/server.crt" as a default.

TLS Autogeneration

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.

tls.days

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.

tls.writeCert

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.

Rupert-Grunt Testing Configuration

server

String. Path to the main server file in the Rupert application. Will use APP_SERVER from the environment, or process.cwd() + "/app.js"

jshint

Options to control [jshint][jshint].

[jshint]:

jshint.rc

String. Path to a [jshint configuration file][jshrc]. Will use JSHINTRC from the environment, or .jshintrc as a default.

[jshrc]:

jshint.files

Array. File globs to run jshinting on. Always includes [ 'src/**/*.js', 'Gruntfile.js' ], and the glob is anchored at the project root.

coffeelint

Options to control [coffeelint][clint]

[clint]:

coffeelint.rc

String. Path to a [coffeelint configuration file][clhrc]. Will use COFFEELINTRC from the environment, or .coffeelintrc as a default.

[clhrc]:

coffeelint.files

Array. File globs to run coffeelinting on. Always includes [ 'src/**/*.coffee', 'Gruntfile.coffee' ], and the glob is anchored at the project root.

client

Configuration settings for client tests.

client.root

Root of client globs. Defaults to src/client.

client.files

Additional client files to test. Defaults to ['www/vendors.js', 'www/template.js', 'www/application.js'].

client.test.tools

Array of globs for additional support tools. Includes ['tools/**', '**/*mock.{js,coffee}' ] and all values are prefixed with client.root

client.write.target

String path from project root to place compiled final files. Uses WRITE_TARGET from the environment, or ./www as a default.

client.browsers

List of browsers to run unit tests in. Uses a heuristic to determine one of PhantomJS, Chrome, or Firefox as a default.

features.steps

String folder, relative to the project root, to pass as the steps folder to CucumberJS. Uses ./src/features/steps as a default.