@wxn0brp/falcon-frame 0.0.19 → 0.0.21
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/dist/helpers.js +6 -0
- package/dist/req.js +1 -1
- package/package.json +1 -1
package/dist/helpers.js
CHANGED
|
@@ -83,6 +83,12 @@ export function handleStaticFiles(dirPath, utf8 = true) {
|
|
|
83
83
|
return true;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
+
const htmlPath = filePath + ".html";
|
|
87
|
+
if (fs.existsSync(htmlPath) && fs.statSync(htmlPath).isFile()) {
|
|
88
|
+
res.ct(getContentType(htmlPath, utf8));
|
|
89
|
+
fs.createReadStream(htmlPath).pipe(res);
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
86
92
|
next();
|
|
87
93
|
};
|
|
88
94
|
}
|
package/dist/req.js
CHANGED
|
@@ -15,7 +15,7 @@ export function handleRequest(req, res, FF) {
|
|
|
15
15
|
const [path, params] = (req.url || "").split("?");
|
|
16
16
|
const normalizedPath = path.replace(/\/{2,}/g, "/");
|
|
17
17
|
const parsedUrl = new URL(normalizedPath + (params ? `?${params}` : ""), "http://localhost");
|
|
18
|
-
req.path = parsedUrl.pathname || "/";
|
|
18
|
+
req.path = decodeURIComponent(parsedUrl.pathname) || "/";
|
|
19
19
|
req.query = Object.fromEntries(parsedUrl.searchParams);
|
|
20
20
|
}
|
|
21
21
|
catch (e) {
|