This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
node-task/node_modules/express-myconnection/examples/single/routes/index.js

18 lines
415 B
JavaScript

/*
* GET home page.
*/
exports.index = function (req, res, next) {
req.getConnection(function (err, connection) {
connection.query('SELECT ? AS RESULT', ['Hello World!'], function (err, results) {
if (err) return next(err);
res.render('index', {
title: 'express-myconnection',
result: results[0].RESULT
});
});
});
};