diff --git a/assets/openapi.json b/assets/openapi.json index c08c281..78204cc 100644 --- a/assets/openapi.json +++ b/assets/openapi.json @@ -23561,6 +23561,12 @@ }, "tags": [ "auth" + ], + "x-badges": [ + { + "label": "Spacebar-only", + "color": "red" + } ] } }, diff --git a/flake.nix b/flake.nix index c0fc2aa..3f8cb42 100644 --- a/flake.nix +++ b/flake.nix @@ -60,7 +60,6 @@ Cmd = [ "${self.outputs.packages.${system}.default}/bin/start-${mod}" ]; Expose = [ "3001" ]; }; - } ); }; diff --git a/src/api/Server.ts b/src/api/Server.ts index f79e7dc..7d0596a 100644 --- a/src/api/Server.ts +++ b/src/api/Server.ts @@ -97,8 +97,9 @@ // Emma [it/its] @ Rory& - the _ is required now, as pillarjs throw an error if you don't pass a param name now api.use("*_", (req: Request, res: Response) => { res.status(404).json({ - message: "404 endpoint not found", - code: 0, + message: "Endpoint not found", + code: 404, + request: `${req.method} ${req.url}`, }); }); diff --git a/src/api/middlewares/ErrorHandler.ts b/src/api/middlewares/ErrorHandler.ts index 1a9a18a..87e44c6 100644 --- a/src/api/middlewares/ErrorHandler.ts +++ b/src/api/middlewares/ErrorHandler.ts @@ -61,9 +61,9 @@ if (httpcode > 511) httpcode = 400; - res.status(httpcode).json({ code: code, message, errors, _ajvErrors }); + res.status(httpcode).json({ code, message, errors, _ajvErrors, request: `${req.method} ${req.url}` }); } catch (error) { console.error(`[Internal Server Error] 500`, error); - return res.status(500).json({ code: 500, message: "Internal Server Error" }); + return res.status(500).json({ code: 500, message: `Internal server error while handling error`, request: `${req.method} ${req.url}` }); } }