@eonasdan/parvus-server
Advanced tools
Comparing version 1.1.3 to 1.1.5
@@ -129,3 +129,3 @@ 'use strict'; | ||
async defaultHandler(req, res, directory, addSocket = true) { | ||
let url = req.url; | ||
let url = new URL(req.url, 'https://z').pathname; | ||
if (url.endsWith('/')) | ||
@@ -139,3 +139,3 @@ url += 'index.html'; | ||
try { | ||
const filePath = path__namespace.join(__dirname, directory, url); | ||
const filePath = path__namespace.join(directory, url); | ||
let fileExists = await fs.promises.stat(filePath); | ||
@@ -147,3 +147,3 @@ if (!fileExists) { | ||
<html lang="en"> | ||
<body> | ||
<body style="background-color: #1717;"> | ||
<h3>Page not found</h3> | ||
@@ -182,3 +182,3 @@ </body> | ||
res.writeHead(500); | ||
res.end(`<html lang="en"><body><h1>Error</h1>Failed to load requested file at ${url}</body></html>`); | ||
res.end(`<html lang="en"><body style="background-color: #1717;"><h1>Error</h1>Failed to load requested file at ${url}</body></html>`); | ||
} | ||
@@ -185,0 +185,0 @@ } |
{ | ||
"name": "@eonasdan/parvus-server", | ||
"version": "1.1.3", | ||
"version": "1.1.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/server.js", |
@@ -6,3 +6,1 @@ # Parvus node server | ||
Mostly, I'm testing this out to be part of my headless cms. | ||
Examples aren't working currently. |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
112119
1
6