fetchNoticeList.js
393 Bytes
const mysql = require("mysql");
var noticeList = async function(req,res){
var connection = mysql.createConnection({
host: "34.64.183.182",
user: 'root',
password: '',
database: 'KhuNotice'
});
connection.connect();
connection.query(req.body.sql,function(err,rows){
if(err){
console.log(err);
}
res.send(rows);
})
}
module.exports = noticeList;