wok-server 0.4.1 → 0.4.2
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.
|
@@ -161,7 +161,11 @@ class StaticHandler {
|
|
|
161
161
|
await this.endRespWithBuffer(response, file.bufferOrPath);
|
|
162
162
|
}
|
|
163
163
|
else {
|
|
164
|
-
|
|
164
|
+
const path = file.bufferOrPath;
|
|
165
|
+
await new Promise((resolve, reject) => {
|
|
166
|
+
response.once('finish', resolve).once('error', reject);
|
|
167
|
+
(0, fs_1.createReadStream)(path).pipe((0, zlib_1.createGzip)()).pipe(response);
|
|
168
|
+
});
|
|
165
169
|
}
|
|
166
170
|
return true;
|
|
167
171
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wok-server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"packageManager": "pnpm@8.9.0",
|
|
5
5
|
"description": "一个基于 NodeJs 和 TypeScript 的后端框架,轻量级、克制、简洁。A lightweight, restrained, and concise backend framework based on Node.js and TypeScript.",
|
|
6
6
|
"scripts": {
|