@webtypen/webframez-core 0.0.44 → 0.0.45
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/lib/Router/Router.js +17 -0
- package/package.json +1 -1
- package/src/Router/Router.ts +19 -0
package/lib/Router/Router.js
CHANGED
|
@@ -222,6 +222,21 @@ class RouterFacade {
|
|
|
222
222
|
});
|
|
223
223
|
})
|
|
224
224
|
: null;
|
|
225
|
+
const urlParams = {};
|
|
226
|
+
if (req && req.url && req.url.indexOf("?") > 0) {
|
|
227
|
+
const temp = req.url.substring(req.url.indexOf("?") + 1);
|
|
228
|
+
if (temp && temp.trim() !== "") {
|
|
229
|
+
const entries = temp.split("=");
|
|
230
|
+
for (let entry of entries) {
|
|
231
|
+
if (entry.indexOf("=") > 0) {
|
|
232
|
+
urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(entry.indexOf("=") + 1);
|
|
233
|
+
}
|
|
234
|
+
else {
|
|
235
|
+
urlParams[entry] = true;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
225
240
|
const request = this.mode === "aws-lambda" && customRequest
|
|
226
241
|
? {
|
|
227
242
|
body: bodyPlain &&
|
|
@@ -236,6 +251,7 @@ class RouterFacade {
|
|
|
236
251
|
: {},
|
|
237
252
|
bodyPlain: bodyPlain,
|
|
238
253
|
params: route && route.params ? route.params : {},
|
|
254
|
+
urlParams: urlParams,
|
|
239
255
|
headers: customRequest.headers,
|
|
240
256
|
method: customRequest.method,
|
|
241
257
|
}
|
|
@@ -251,6 +267,7 @@ class RouterFacade {
|
|
|
251
267
|
: {},
|
|
252
268
|
bodyPlain: bodyPlain,
|
|
253
269
|
params: route && route.params ? route.params : {},
|
|
270
|
+
urlParams: urlParams,
|
|
254
271
|
httpVersionMajor: req.httpVersionMajor,
|
|
255
272
|
httpVersionMinor: req.httpVersionMinor,
|
|
256
273
|
httpVersion: req.httpVersion,
|
package/package.json
CHANGED
package/src/Router/Router.ts
CHANGED
|
@@ -266,6 +266,23 @@ class RouterFacade {
|
|
|
266
266
|
})
|
|
267
267
|
: null;
|
|
268
268
|
|
|
269
|
+
const urlParams: any = {};
|
|
270
|
+
if (req && req.url && req.url.indexOf("?") > 0) {
|
|
271
|
+
const temp = req.url.substring(req.url.indexOf("?") + 1);
|
|
272
|
+
if (temp && temp.trim() !== "") {
|
|
273
|
+
const entries = temp.split("=");
|
|
274
|
+
for (let entry of entries) {
|
|
275
|
+
if (entry.indexOf("=") > 0) {
|
|
276
|
+
urlParams[entry.substring(0, entry.indexOf("="))] = entry.substring(
|
|
277
|
+
entry.indexOf("=") + 1
|
|
278
|
+
);
|
|
279
|
+
} else {
|
|
280
|
+
urlParams[entry] = true;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
269
286
|
const request =
|
|
270
287
|
this.mode === "aws-lambda" && customRequest
|
|
271
288
|
? {
|
|
@@ -285,6 +302,7 @@ class RouterFacade {
|
|
|
285
302
|
|
|
286
303
|
bodyPlain: bodyPlain,
|
|
287
304
|
params: route && route.params ? route.params : {},
|
|
305
|
+
urlParams: urlParams,
|
|
288
306
|
headers: customRequest.headers,
|
|
289
307
|
method: customRequest.method,
|
|
290
308
|
}
|
|
@@ -301,6 +319,7 @@ class RouterFacade {
|
|
|
301
319
|
: {},
|
|
302
320
|
bodyPlain: bodyPlain,
|
|
303
321
|
params: route && route.params ? route.params : {},
|
|
322
|
+
urlParams: urlParams,
|
|
304
323
|
httpVersionMajor: req.httpVersionMajor,
|
|
305
324
|
httpVersionMinor: req.httpVersionMinor,
|
|
306
325
|
httpVersion: req.httpVersion,
|