Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Latest commit

 

History

History
48 lines (40 loc) · 1.69 KB

README.md

File metadata and controls

48 lines (40 loc) · 1.69 KB

knekshelf

Build Status Coverage Status Code Climate NPM Version NPM Downloads
Dependency Status Known Vulnerabilities

Expose raw knex and bookshelf on Hapi.

Usage

const Knekshelf = require('knekshelf');
const server = new Hapi.Server();

server.register({
    register: Knekshelf,
    options: {
        knex: {
            client: 'pg',
            searchPath: 'public',
            connection: 'postgres://postgres:postgres@localhost:5432/postgres'
        },
        plugins: [
            'registry',
            'pagination',
            require('bookshelf-cascade-delete')
        ]
    }
});

// available through server.plugins
server.plugins.knekshelf.bookshelf
server.plugins.knekshelf.knex

// available through plugin
Knekshelf.ext.bookshelf
Knekshelf.ext.ext

pg was used for testing.

Contributing