Skip to content
This repository was archived by the owner on Sep 1, 2020. It is now read-only.

mozilla/openbadges-badges

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

84 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenBadges Badges

Mozilla Open Badges issues Open Badges.

Usage

> node app

Configuration

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.

Command line arguments

Pass these in when starting the app, like so:

> node app --port 3456 --apiEndpoint http://example.com/api

JSON configuration

If the app finds a config.json file in the root, it will use parameters in this file where possible.

{
	"port": 3456
	"api": {
		"endpoint": "http://example.com/api"
	}
}

Environment variables

Finally, configuration will be picked up from the environment. This is most easily done by writing a config.env file (or similar):

export PORT=3456
export API_ENDPOINT='http://example.com/api'

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 LICENSE for more details.

About

Mozilla Open Badges issues Open Badges.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •