Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/firstandthird/hapi-confi
Set up hapi from a config file
https://github.com/firstandthird/hapi-confi
hapi-plugin hapi-v17 has-tests needs-coverage
Last synced: 14 days ago
JSON representation
Set up hapi from a config file
- Host: GitHub
- URL: https://github.com/firstandthird/hapi-confi
- Owner: firstandthird
- License: mit
- Created: 2015-09-26T20:28:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-02-19T01:32:42.000Z (almost 4 years ago)
- Last Synced: 2025-01-02T10:46:37.380Z (about 1 month ago)
- Topics: hapi-plugin, hapi-v17, has-tests, needs-coverage
- Language: JavaScript
- Size: 302 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## hapi-confi [![Build Status](https://travis-ci.org/firstandthird/hapi-confi.svg?branch=master)](https://travis-ci.org/firstandthird/hapi-confi) [![Coverage Status](https://coveralls.io/repos/github/firstandthird/hapi-confi/badge.svg?branch=master)](https://coveralls.io/github/firstandthird/hapi-confi?branch=master)
Set up and run a hapi server using yaml/json files from a config directory
### Installation
`npm install hapi-confi`
### Usage
```
var Hapi = require('hapi');
var hapiConfi = require('hapi-confi');
hapiConfi(Hapi, options, function(err, server, config) {
/* server is a configured hapi server here */
server.start(function(){
});
}
```### Options
- `configPath` - relative to 'cwd', defaults to 'conf/'
- `server` - standard hapi server configuration options, see hapi docs for available options.### Major Config items:
- `before` - list of event handlers to fire on a 'before' event
- `logging` - list of reporters to use from 'good.js', the hapi logging library
- `reporters` - any 'good-' reporters to use for logging (e.g. good-console)
- `authPlugins` - list of auth plugins
- `strategies` - list of strategies of the form:
- `provider`
- `scheme`
- `mode`
- `options`
- `profile` -
- `plugins` - list of hapi plugins that will be added to your server through hapi.register()
- `options` - options to pass when the plugin is registered
- `views` - list of view engines to register with hapi.views()
- `engines` - list of modules to import and pass to view
- `validator` - optional validator library for hapi v19+ (usually '@hapi/joi')