fetchNoticeList.js
446 Bytes
const mysql = require("mysql");
var noticeList = async function(req,res){
var result = [];
var connection = mysql.createConnection({
host: "34.64.183.182",
user: 'root',
password: '',
database: 'KhuNotice'
});
connection.connect();
connection.query('select * from noticeList order by date desc',function(err,rows){
if(err){
console.log(err);
}
res.send(rows);
})
}
module.exports = noticeList;