OpenBadges Badges is optionally configured through three different systems (in order or preference):
command line arguments
a JSON configuration file
environment variables
These can be accessed within the app like so:
var config = require('./lib/config');
var port = config('PORT', 3000);
var endpoint = config('API_ENDPOINT');
If a default value is given, it will be returned if not found elsewhere in the configuration. If it is not given, and no value is found, a ReferenceError will be thrown.
One way or another, the following configuration parameters are required: COOKIE_SECRET, OPENBADGER_URL, OPENBADGER_SECRET, MANDRILL_KEY, SYSTEM_SHORTNAME, HOST.
License
This project is licensed under the Mozilla Public License, version 2.0. See the included LICENSE for more details.
OpenBadges Badges
Mozilla Open Badges issues Open Badges.
Usage
Configuration
OpenBadges Badges is optionally configured through three different systems (in order or preference):
These can be accessed within the app like so:
If a default value is given, it will be returned if not found elsewhere in the configuration. If it is not given, and no value is found, a
ReferenceErrorwill be thrown.Command line arguments
Pass these in when starting the app, like so:
JSON configuration
If the app finds a
config.jsonfile in the root, it will use parameters in this file where possible.Environment variables
Finally, configuration will be picked up from the environment. This is most easily done by writing a
config.envfile (or similar):Then you can source the file like
. config.env.Environment
One way or another, the following configuration parameters are required:
COOKIE_SECRET,OPENBADGER_URL,OPENBADGER_SECRET,MANDRILL_KEY,SYSTEM_SHORTNAME,HOST.License
This project is licensed under the Mozilla Public License, version 2.0. See the included
LICENSEfor more details.