iut-hapi/knexfile.js

21 lines
594 B
JavaScript
Raw Permalink Normal View History

2021-04-12 03:24:33 +00:00
'use strict';
const Path = require('path');
const Hoek = require('@hapi/hoek');
const Manifest = require('./server/manifest');
const Plugin = require('./lib/plugins/@hapipal.schwifty');
// Take schwifty registration's knex option
// but specify the plugin's migrations directory
module.exports = Hoek.applyToDefaults(
{
migrations: {
directory: Path.relative(process.cwd(), Plugin.options.migrationsDir)
}
},
Manifest
.get('/register/plugins', process.env)
.find(({ plugin }) => plugin === '@hapipal/schwifty')
.options.knex
);