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',
|
|
|
|
$default: 3000
|
|
|
|
},
|
|
|
|
debug: {
|
|
|
|
$filter: 'NODE_ENV',
|
|
|
|
$default: {
|
|
|
|
log: ['error', 'start'],
|
|
|
|
request: ['error']
|
|
|
|
},
|
|
|
|
production: {
|
|
|
|
request: ['implementation']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
register: {
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
plugin: '../lib', // Main plugin
|
|
|
|
options: {}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
plugin: '@hapipal/schwifty',
|
|
|
|
options: {
|
|
|
|
$filter: 'NODE_ENV',
|
|
|
|
$default: {},
|
|
|
|
$base: {
|
|
|
|
migrateOnStart: true,
|
|
|
|
knex: {
|
|
|
|
client: 'sqlite3',
|
|
|
|
useNullAsDefault: true, // Suggested for sqlite3
|
|
|
|
connection: {
|
|
|
|
filename: ':memory:'
|
|
|
|
},
|
|
|
|
migrations: {
|
|
|
|
stub: Schwifty.migrationsStubPath
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
production: {
|
|
|
|
migrateOnStart: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
plugin: {
|
|
|
|
$filter: 'NODE_ENV',
|
|
|
|
$default: '@hapipal/hpal-debug',
|
|
|
|
production: Toys.noop
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
});
|