Commit fb2145d5 authored by Matthieu - Greep's avatar Matthieu - Greep

Create basic Error handeler

parent 6403d098
......@@ -51,6 +51,15 @@ function checkToken(req, res, next, sql){
}
}
function renderError(res, status, message){
res.status(status || 500).json({
error: {
code: status || 500,
message: message
}
});
}
const port = process.env.PORT || 8080;
const app = express()
......
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