const Dotenv = require('dotenv'); const Confidence = require('@hapipal/confidence'); const Inert = require('@hapi/inert'); const Vision = require('@hapi/vision'); const Schwifty = require('@hapipal/schwifty'); const HapiSwagger = require('hapi-swagger'); const AppPlugin = require('../lib/plugins'); // 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: { $filter: 'NODE_ENV', $default: { $param: 'PORT', $coerce: 'number', $default: 3001 }, test: { $value: undefined } // Let the server find an open port }, debug: { $filter: 'NODE_ENV', $default: { log: ['error', 'start'], request: ['error'] }, production: { request: ['implementation'] } } }, register: { plugins: [ AppPlugin, // Documentaion deps Inert, Vision, { plugin: HapiSwagger, options: { info: { title: 'Test API Documentation' } } }, { plugin: Schwifty, options: { $filter: 'NODE_ENV', $default: {}, $base: { migrateOnStart: true, knex: { client: 'mysql', useNullAsDefault: true, connection: { host : 'localhost', user : 'root', password : 'root', database : 'test' } } }, production: { migrateOnStart: false } } } ] } });