NotFoundErrorHandler.js 654 B

1234567891011121314151617
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.NotFoundErrorHandler = void 0;
  4. const http_1 = require("../base/http");
  5. const i18n_1 = require("../base/i18n");
  6. class NotFoundErrorHandler extends http_1.Middleware {
  7. constructor() {
  8. super(...arguments);
  9. this.order = 9999;
  10. this.route = null;
  11. this.action = (req, res, next) => {
  12. res.status(http_1.StatusCodes.NOT_FOUND).send((0, i18n_1.$$)('org.crazydoctor.expressts.httpError.404', { url: req.url }));
  13. };
  14. }
  15. }
  16. exports.NotFoundErrorHandler = NotFoundErrorHandler;
  17. //# sourceMappingURL=NotFoundErrorHandler.js.map