Skip to content

Commit 43b06c1

Browse files
Fix status code when spa route redirecting to index.html (#41)
* Fix status code when spa route redirecting to index.html * v4.5.2 Co-authored-by: Aldo D'Aquino <[email protected]>
1 parent 88bfffb commit 43b06c1

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const createServer = (domain = "localhost") => {
6969
if (fs.existsSync(p404))
7070
res.status(404).sendFile(path.resolve(p404))
7171
else if (fs.existsSync(index))
72-
res.status(404).sendFile(path.resolve(index))
72+
res.status(200).sendFile(path.resolve(index))
7373
else res.status(404).send(req.path + " not found.")
7474
})
7575
console.info("Serving static path: " + staticPath)

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "https-localhost",
3-
"version": "4.5.1",
3+
"version": "4.5.2",
44
"description": "HTTPS server running on localhost",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)