Skip to content

consulate/consulate-scopes-env

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

consulate-scopes-env Build Status

Load scopes for consulate from a process.env value

Usage

Just register consulate-scopes-env as a plugin with your consulate server:

var consulate = require('consulate')
  , scopes = require('consulate-scopes-env');

var app = consulate();

app.plugin(scopes({
  name: 'MY_SCOPES_VAR', // defaults to 'SCOPES'
  placeholder: '_', // defaults to 'null'
  separator: '|' // defaults to ','
}));

Before starting the server, set the environment variable:

$ MY_SCOPES_VAR='emails|users|_|sales' node app

The scopes will be parsed into an array:

[
  'emails',
  'users',
  null,
  'sales'
]

Tests

$ npm test

About

Load scopes for consulate from a process.env value

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published