hapi-knex2

0.0.4 • Public • Published

hapi-knex2

Knex plugin for hapi.

Install

$ npm install knex hapi-knex2

Usage

For knex to work install one of the database drivers found in the knex documentation. Then you can do as follows:

const Hapi = require('hapi');
 
const server = new Hapi.Server(/* options */);
 
// some other stuff ...
 
server.register({
  register: require('hapi-knex2'),
  options: {
    knex: {
      client: 'mysql',
      connection: {
        host : '127.0.0.1',
        user : 'your_database_user',
        password : 'your_database_password',
        database : 'myapp_test'
      },
    },
  },
}, err => {
  if (err) throw err;
 
  server.start();
});

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i hapi-knex2

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • sebasgarcep