hapi-conf

1.1.0 • Public • Published

hapi-conf

hapi-conf loads environment variables using dotenv and exposes with a hapi server method. Environment variables are filtered and parsed as JSON with filter-env.

Circle CI bitHound Overall Score bitHound Dependencies

Usage

The following example loads environment variables from .env and filters the variables

const fs = require('fs');
const Hapi = require('hapi');
const hapiConf = requre('hapi-conf');
const server = new Hapi.Server({});
hapiConf(server, /^TEST-/, { env: fs.readFileSync('./.env'), json: true, freeze: true });

Dependencies (3)

Dev Dependencies (5)

Package Sidebar

Install

npm i hapi-conf

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • davidwood