Desplegando App
This commit is contained in:
18
node_modules/express-myconnection/examples/single/routes/index.js
generated
vendored
Normal file
18
node_modules/express-myconnection/examples/single/routes/index.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* 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
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
};
|
||||
Reference in New Issue
Block a user