Dead-simple MySQL plugin for Hapi. Usage:
Register plugin:
varserver=Hapi.createServer('0.0.0.0',8000);server.pack.require('hapi-mysql',Config.db,function(err){if(err){console.error(err);throwerr;}});Use plugin:
request.server.plugins['hapi-mysql'].pool.getConnection(function(err,connection){// Use the connectionconnection.query('SELECT 1 FROM mytable',function(err,rows){if(err){thrownewError(err)}})// And done with the connection.connection.release();})