Add missing status codes and rename enum members to PascalCase
Change-Id: Iab2893d75ac7cb797364a7a2e33a7140cc9d97db
diff --git a/server/src/app.ts b/server/src/app.ts
index 2d4fd7d..85e6b10 100644
--- a/server/src/app.ts
+++ b/server/src/app.ts
@@ -16,10 +16,10 @@
* <https://www.gnu.org/licenses/>.
*/
import express, { json, NextFunction, Request, Response } from 'express';
+import { HttpStatusCode } from 'jami-web-common';
import log from 'loglevel';
import { Service } from 'typedi';
-import { StatusCode } from './constants.js';
import { accountRouter } from './routers/account-router.js';
import { authRouter } from './routers/auth-router.js';
@@ -36,13 +36,13 @@
// Setup 404 error handling
app.use((_req, res) => {
- res.sendStatus(StatusCode.NOT_FOUND);
+ res.sendStatus(HttpStatusCode.NotFound);
});
// Setup internal error handling
app.use((err: Error, _req: Request, res: Response, _next: NextFunction) => {
log.error(err);
- res.status(StatusCode.INTERNAL_SERVER_ERROR).send(err.message);
+ res.status(HttpStatusCode.InternalServerError).send(err.message);
});
return app;