Robust user management for Hapi
npm install pallies

Pallies is a user management plugin for hapi, designed to work best with
hapipal.
This guide assumes you've already created a hapi project using hpal
Looking for a starting point? Check the Pallies Demo Repo.
#### Install the Pallies module from npm
``bash`
npm install --save pallies
#### Configure Pallies
Create a configuration file at server/.palliesrc.js
#### Update Your Manifest
`jslib/plugins/pallies.js
// Register Pallies as a plugin in
'use strict';
const PalliesConfig = require('../../server/.palliesrc');
const User = require('../models/user');
module.exports = (server, options) => ({
plugins: {
options: {
isDev : options.isDev,
...PalliesConfig
}
}
});
``
`js`
// Register Schwifty in server/manifest.js
{
plugin: 'schwifty',
options: {
$filter: { $env: 'NODE_ENV' },
$default: {},
$base: {
migrateOnStart: true,
knex: {
client: 'pg',
connection: {
host: { $env: 'DB_HOST' },
user: { $env: 'DB_USER' },
password: { $env: 'DB_PASSWORD' },
database: { $env: 'DB_DATABASE' }
},
migrations: {
stub: 'Schwifty.migrationsStubPath'
}
}
},
production: {
migrateOnStart: false
}
}
}
#### Update knexfile.js
Add the Pallies migration directory to your migrations configuration
`js`
// ...
migrations: {
directory: [
'node_modules/pallies/lib/migrations',
Path.relative(process.cwd(), PluginConfig.migrationsDir)
]
}
//...
#### Apply database migrations
`bash``
npx knex migrate:latest