mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2026-05-01 17:50:10 +00:00
BETTERZON-38: Added error handler, preparation for DB accessing
This commit is contained in:
@@ -7,6 +7,8 @@ import express from "express";
|
||||
import cors from "cors";
|
||||
import helmet from "helmet";
|
||||
import { productsRouter } from "./products/products.router";
|
||||
import { errorHandler } from "./middleware/error.middleware";
|
||||
import {notFoundHandler} from "./middleware/notFound.middleware";
|
||||
|
||||
dotenv.config();
|
||||
|
||||
@@ -33,6 +35,9 @@ app.use(cors());
|
||||
app.use(express.json());
|
||||
app.use("/products", productsRouter);
|
||||
|
||||
app.use(errorHandler);
|
||||
app.use(notFoundHandler);
|
||||
|
||||
|
||||
/**
|
||||
* Server Activation
|
||||
|
||||
Reference in New Issue
Block a user