Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ platform based on [Metarhia technology stack](https://github.com/metarhia) and

## Requirements

- Node.js v12.5.0 or later (v14 preferred)
- Node.js v12.9.0 or later (v14 preferred)
- Linux (tested on Fedora 30, Ubuntu 16, 18, 19 and 20, CentOS 7 and 8)
- Postgresql 9.5 or later (v11.8 preferred)
- OpenSSL v1.1.1 or later
Expand Down
3 changes: 2 additions & 1 deletion lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class Client {
const fileExt = path.extname(filePath).substring(1);
const mimeType = MIME_TYPES[fileExt] || MIME_TYPES.html;
res.writeHead(200, { ...HEADERS, 'Content-Type': mimeType });
if (res.writableEnded) return;
const data = application.static.get(filePath);
if (data) res.end(data);
else this.error(404);
Expand All @@ -63,7 +64,7 @@ class Client {
connection.send(result);
return;
}
if (res.finished) return;
if (res.writableEnded) return;
res.writeHead(status, { 'Content-Type': MIME_TYPES.json });
res.end(result);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"homepage": "https://github.com/HowProgrammingWorks/NodejsStarterKit",
"engines": {
"node": ">=12.5.0"
"node": ">=12.9.0"
},
"devDependencies": {
"eslint": "^7.4.0"
Expand Down