rjweb-server
Advanced tools
Comparing version 0.6.6 to 0.6.7
16
index.js
@@ -31,3 +31,3 @@ const { getAllFiles, getAllFilesFilter } = require('./utils/getAllFiles.js') | ||
if (!types.includes(type)) throw TypeError(`No Valid Request Type: ${type}\nPossible Values: ${types.toString()}`) | ||
this.urls[url] = { | ||
this.urls[type + url] = { | ||
array: url.split('/'), | ||
@@ -61,3 +61,3 @@ type, | ||
this.urls[urlName]= { | ||
this.urls['GET' + urlName]= { | ||
file, | ||
@@ -88,3 +88,3 @@ array: fileName.split('/'), | ||
this.urls[route.path] = { | ||
this.urls[route.type + route.path] = { | ||
array: route.path.split('/'), | ||
@@ -178,4 +178,4 @@ type: route.type, | ||
for (const elementName in urls) { | ||
if (elementName in urls && elementName === reqUrl.pathname && urls[elementName].type === req.method) { | ||
executeUrl = reqUrl.pathname | ||
if (elementName in urls && elementName.replace(req.method, '') === reqUrl.pathname && urls[elementName].type === req.method) { | ||
executeUrl = req.method + reqUrl.pathname | ||
isStatic = false | ||
@@ -185,4 +185,4 @@ exists = true | ||
break | ||
}; if (elementName in urls && elementName === reqUrl.pathname && urls[elementName].type === 'STATIC') { | ||
executeUrl = reqUrl.pathname | ||
}; if (elementName in urls && elementName.replace(req.method, '') === reqUrl.pathname && urls[elementName].type === 'STATIC') { | ||
executeUrl = req.method + reqUrl.pathname | ||
isStatic = true | ||
@@ -210,3 +210,3 @@ exists = true | ||
params.set(urlParam.replace(':', ''), decodeURIComponent(reqParam)) | ||
executeUrl = element.array.join('/') | ||
executeUrl = req.method + element.array.join('/') | ||
exists = true | ||
@@ -213,0 +213,0 @@ |
{ | ||
"name": "rjweb-server", | ||
"version": "0.6.6", | ||
"version": "0.6.7", | ||
"description": "Easy and Lightweight Way to create a Web Server in Node.js", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23992