Created
March 17, 2022 09:42
-
-
Save paulobunga/45126639bc892aef72066de4813c8203 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Get all employees from the database | |
app.get("/employees", (req, res) => { | |
db.query("SELECT * from employees", (error, data) => { | |
if (error) { | |
return res.json({ status: "ERROR", error }); | |
} | |
return res.json(data); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment