app-spec

0.11.7 • Public • Published

app-spec

Get application configuration from spec of required environment variables.

Usage

We define environment dependencies and defaults via a spec file:

module.exports = {
    description: 'Redis-based caching proxy for Google Maps API queries.',
    required: {
        redisHost: {
            description: 'the Redis host',
            default: 'localhost'
        },
        redisPort: {
            description: 'the Redis port',
            default: 6379
        }
    }
}

The application index.js passes the spec definition and main (entry-point) function to the application archetype.

require('redis-koa-app-rpf')(require('./spec'), require('./main'));

The application archetype uses this library to parse the config from process.env according to the spec and to invoke the main function.

Used by


https://twitter.com/@evanxsummers

Readme

Keywords

none

Package Sidebar

Install

npm i app-spec

Weekly Downloads

31

Version

0.11.7

License

ISC

Last publish

Collaborators

  • evanx