Middleware examples
This commit is contained in:
@@ -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/!"
|
||||
|
||||
Reference in New Issue
Block a user