Skip to content
This repository was archived by the owner on Aug 2, 2022. It is now read-only.

manV/hapi-myconnection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hapi-myconnection

Wrap Hapi requests with access to a Mysql connection from pool.

It gives you access to request.connection within your handlers which you can then use to make Mysql requests. It also releases the connection to the pool after the request.

Usage

// options used to pass mysql driver to create pool
var mysqlOptions = {
  host: 'localhost',
  user: 'anyUser'
};

server.pack.register({
  plugin: require('hapi-myconnection'),
  options: {
    mysql: mysql,
    mysqlOptions: {
      host: 'localhost',
      user: 'root',
      password: 'root'
    }
  }
}, function(err) {
  throw err;
});

License

MIT

About

MySql plugin for Hapi

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors