Skip to content
Snippets Groups Projects
Commit 6e1fb637 authored by Louis-Marie Michelin's avatar Louis-Marie Michelin
Browse files

docs: add comments

parent 8099a147
Branches
No related tags found
No related merge requests found
...@@ -20,10 +20,13 @@ app.use(cors()); ...@@ -20,10 +20,13 @@ app.use(cors());
app.use(express.json()); app.use(express.json());
app.use(express.urlencoded({ extended: false })); app.use(express.urlencoded({ extended: false }));
// Register routes
app.use("/", indexRouter); app.use("/", indexRouter);
app.use("/users", usersRouter); app.use("/users", usersRouter);
app.use(routeNotFoundJsonHandler);
app.use(jsonErrorHandler); // Register 404 middleware and error handler
app.use(routeNotFoundJsonHandler); // this middleware must be registered after all routes to handle 404 correctly
app.use(jsonErrorHandler); // this error handler must be registered after all middlewares to catch all errors
const port = parseInt(process.env.PORT || "3000"); const port = parseInt(process.env.PORT || "3000");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment