iut-hapi/server/manifest.js

73 lines
2.0 KiB
JavaScript
Raw Normal View History

2021-04-12 03:24:33 +00:00
'use strict';
const Dotenv = require('dotenv');
const Confidence = require('@hapipal/confidence');
const Toys = require('@hapipal/toys');
const Schwifty = require('@hapipal/schwifty');
// 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: {
$param: 'PORT',
$coerce: 'number',
2024-01-26 14:37:47 +00:00
$default: 4000
2021-04-12 03:24:33 +00:00
},
debug: {
$filter: 'NODE_ENV',
$default: {
log: ['error', 'start'],
request: ['error']
},
production: {
request: ['implementation']
}
}
},
register: {
plugins: [
{
plugin: '../lib', // Main plugin
options: {}
},
{
2021-04-12 03:24:17 +00:00
plugin: './plugins/swagger'
},
{
plugin : '@hapipal/schwifty',
options : {
$filter : 'NODE_ENV',
$default : {},
$base : {
migrateOnStart : true,
knex : {
client : 'mysql',
connection : {
host : 'localhost',
user : 'root',
password : 'hapi',
database : 'user',
port : 3307
2021-04-12 03:24:33 +00:00
}
}
},
2021-04-12 03:24:17 +00:00
production : {
migrateOnStart : false
2021-04-12 03:24:33 +00:00
}
}
},
{
plugin: {
$filter: 'NODE_ENV',
$default: '@hapipal/hpal-debug',
production: Toys.noop
}
}
]
}
});