const db = require('../services/db');
async function getMultiple(){
const data = await db.query('SELECT id, quote, author FROM quote');
const meta = {page: 1};
return {
data,
meta
}
}
module.exports = {
getMultiple
}
// you can't connect to mysql in client side js
// but you can use it in nodejs which is server-side
// for nodejs you can use package named mysql2
npm i mysql2
// read Doc here
// https://www.npmjs.com/package/mysql2