corebasic 1.0.98 → 1.0.99
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/libs/features.js +6 -0
- package/package.json +1 -1
package/libs/features.js
CHANGED
|
@@ -118,6 +118,12 @@ export const start = async (app, url, file) => {
|
|
|
118
118
|
let feature = getFeature(req.body.feature)
|
|
119
119
|
let topic = feature.topic
|
|
120
120
|
try {
|
|
121
|
+
let params = getFeatureUrl(feature.api).split("/").filter(item => item.startsWith(":"))
|
|
122
|
+
for (let param of params)
|
|
123
|
+
if (!req.params[param])
|
|
124
|
+
throw { status: 404, message: "Resource not found. One or more url parameter not specified" }
|
|
125
|
+
|
|
126
|
+
|
|
121
127
|
if (method === "get") {
|
|
122
128
|
try {
|
|
123
129
|
await feature.handler({...req, headers: req.headers, body: {...req.body, topic} }, res)
|