Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View antoniolazaro's full-sized avatar

Antonio Lazaro antoniolazaro

View GitHub Profile
const getAllCategories = (request, response) => {
pool.query('SELECT id,name FROM category ORDER BY name ASC', (error, results) => {
console.log('vai processar query')
if (error) {
throw error
}
console.log('processou query')
console.log(results.rows)
response.status(200).json(results.rows)
})