Skip to content
/ k7 Public

Connect you database with Hapijs made easy 📼

License

Notifications You must be signed in to change notification settings

thebergamo/k7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k7 Logo

hapi database connector

Build StatusCurrent Version

Lead Maintainer: Marcos Bérgamo

K7 is the simplest way to connect Hapi.js with your favorite Database Mapper, you can use any of ours available connectors for the most populars Databases.

Example Usage

const Hapi = require('hapi');
const Server = new Hapi.Server();

Server.connection({host: 'localhost'});

let options = {
    adapter: require('k7-mongoose'),
    connectionString: 'mongodb://localhost:27017/K7Mongoose'
};

Server.register({
    register: require('k7'),
    options: options
}, (err) => {
    if (err) {
        throw err;
    }
    
    Server.start((err) => {
        if (err) {
            throw err;
        }
        
        Server.log('info', 'Server running at: ' + Server.info.uri);
    });
});

This example does the following:

  1. Setting the k7-mongoose adapter
  2. Setting the connectionString for mongoose connect
  3. Register the k7 to Hapi.js

Adapters

API

See the API Reference.

About

Connect you database with Hapijs made easy 📼

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •