Skip to content

Commit

Permalink
remove compression middleware from adapter-node output server (#5506)
Browse files Browse the repository at this point in the history
* remove compression middleware from adapter-node output server

* update lockfile
  • Loading branch information
Rich-Harris committed Jul 14, 2022
1 parent a74007b commit 5ed9a32
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 124 deletions.
5 changes: 5 additions & 0 deletions .changeset/slimy-ways-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/adapter-node': patch
---

[breaking] remove compression middleware from adapter-node output server
2 changes: 0 additions & 2 deletions packages/adapter-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,8 @@
"devDependencies": {
"@rollup/plugin-json": "^4.1.0",
"@sveltejs/kit": "workspace:*",
"@types/compression": "^1.7.2",
"@types/node": "^16.11.36",
"c8": "^7.11.3",
"compression": "^1.7.4",
"node-fetch": "^3.2.4",
"polka": "^1.0.0-next.22",
"rimraf": "^3.0.2",
Expand Down
8 changes: 1 addition & 7 deletions packages/adapter-node/src/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
import { handler } from './handler.js';
import { env } from './env.js';
import compression from 'compression';
import polka from 'polka';

export const path = env('SOCKET_PATH', false);
export const host = env('HOST', '0.0.0.0');
export const port = env('PORT', !path && '3000');

const server = polka().use(
// https://github.com/lukeed/polka/issues/173
// @ts-ignore - nothing we can do about so just ignore it
compression({ threshold: 0 }),
handler
);
const server = polka().use(handler);

server.listen({ path, host, port }, () => {
console.log(`Listening on ${path ? path : host + ':' + port}`);
Expand Down
115 changes: 0 additions & 115 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5ed9a32

Please sign in to comment.