Commit 7681b81e authored by Athanasios's avatar Athanasios
Browse files

Error handler

parent 09b8a0fc
......@@ -3,6 +3,7 @@ const config = require('./config')
const cors = require("./src/cors");
const scenelayers = require("./routes/scenelayers");
const nodes = require("./routes/nodes");
const errorHandler = require("./src/errorHandler");
const port = config.PORT || 9000;
const app = express();
......@@ -15,6 +16,7 @@ app.get("/favicon.ico", function (req, res) {
app.use(cors);
app.use("/scenelayers", scenelayers);
app.use("*nodes", nodes);
app.use(errorHandler);
app.listen(port, err => {
if (err) {
......
const notFound = (err, req, res, next) => {
res.sendStatus(404);
res.end();
}
module.exports = notFound;
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment