Middleware examples

This commit is contained in:
Federico Kereki
2018-05-07 21:59:58 -03:00
parent 003bd8f64f
commit e0763a54d2
3 changed files with 60 additions and 0 deletions
+5
View File
@@ -20,6 +20,11 @@ app.get("/license", (req, res) =>
res.sendFile(`${flagsPath}/license.txt`)
);
app.use((err, req, res, next) => {
console.error("Error....", err.message);
res.status(500).send("INTERNAL SERVER ERROR");
});
app.listen(8080, () =>
console.log(
"Mini Express static server ready at http://localhost:8080/!"