zyket 1.1.3 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ const fg = require('fast-glob');
|
|
|
8
8
|
const Middleware = require("./Middleware");
|
|
9
9
|
const swaggerJsDoc = require("swagger-jsdoc");
|
|
10
10
|
const swaggerUi = require("swagger-ui-express");
|
|
11
|
+
const RedirectResponse = require("./RedirectResponse");
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
module.exports = class Express extends Service {
|
|
@@ -70,6 +71,7 @@ module.exports = class Express extends Service {
|
|
|
70
71
|
async (req, res) => {
|
|
71
72
|
try {
|
|
72
73
|
const routeResponse = await route[methodName]({ container: this.#container, request: req, response: res });
|
|
74
|
+
if (routeResponse instanceof RedirectResponse) return res.redirect(routeResponse.url);
|
|
73
75
|
|
|
74
76
|
// Check if response is a buffer (file download)
|
|
75
77
|
if (Buffer.isBuffer(routeResponse)) {
|
|
@@ -125,7 +127,6 @@ module.exports = class Express extends Service {
|
|
|
125
127
|
async (req, res) => {
|
|
126
128
|
try {
|
|
127
129
|
const routeResponse = await route[methodName]({ container: this.#container, request: req, response: res });
|
|
128
|
-
|
|
129
130
|
if (routeResponse instanceof RedirectResponse) return res.redirect(routeResponse.url);
|
|
130
131
|
|
|
131
132
|
// Check if response is a buffer (file download)
|