Refactoring day2 (error handling)

This commit is contained in:
2020-08-22 19:24:33 +02:00
parent b907489a75
commit bf2a9cbf1e
5 changed files with 110 additions and 116 deletions

17
routes/routeTest.js Normal file
View File

@@ -0,0 +1,17 @@
import express from "express";
import * as services from "../services/services.js";
var router = express.Router();
router.post("/", async (req, res) => {
await services
.fetchUser()
.then((response) => {
res.send(response);
})
.catch((e) => {
services.handleError(e, res);
});
});
export default router;