iut-hapi/server/manifest.js

46 lines
1.1 KiB
JavaScript
Raw Normal View History

2024-01-26 13:38:28 +00:00
'use strict';
const Dotenv = require('dotenv');
const Confidence = require('@hapipal/confidence');
const Toys = require('@hapipal/toys');
// Pull .env into process.env
Dotenv.config({ path: `${__dirname}/.env` });
// Glue manifest as a confidence store
module.exports = new Confidence.Store({
server: {
host: 'localhost',
port: {
2021-04-12 03:24:17 +00:00
$param: 'PORT',
2024-01-26 13:38:28 +00:00
$coerce: 'number',
$default: 3000
},
debug: {
2021-04-12 03:24:17 +00:00
$filter: 'NODE_ENV',
2024-01-26 13:38:28 +00:00
$default: {
2021-04-12 03:24:17 +00:00
log: ['error', 'start'],
2024-01-26 13:38:28 +00:00
request: ['error']
},
production: {
request: ['implementation']
}
}
},
register: {
plugins: [
{
plugin: '../lib', // Main plugin
options: {}
},
{
plugin: {
2021-04-12 03:24:17 +00:00
$filter: 'NODE_ENV',
2024-01-26 13:38:28 +00:00
$default: '@hapipal/hpal-debug',
production: Toys.noop
}
}
]
}
});