Skip to content

Commit ba7ad65

Browse files
committed
refactor: remove production-only features
🤖 Generated with [OpenCode](https://opencode.ai) (Smart-router)
1 parent 8ab8b1e commit ba7ad65

4 files changed

Lines changed: 1 addition & 128 deletions

File tree

package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,13 @@
6969
},
7070
"dependencies": {
7171
"appdata-path": "^1.0.0",
72-
"compression": "^1.8.1",
7372
"cors": "^2.8.6",
74-
"express": "^5.2.1",
75-
"uglify-js": "^3.19.3"
73+
"express": "^5.2.1"
7674
},
7775
"devDependencies": {
78-
"@types/compression": "^1.8.1",
7976
"@types/cors": "^2.8.19",
8077
"@types/express": "^5.0.6",
8178
"@types/node": "^26.4.1",
82-
"@types/uglify-js": "^3.17.5",
8379
"oxfmt": "^0.66.0",
8480
"oxlint": "^1.81.0",
8581
"typescript": "^7.0.2"

pnpm-lock.yaml

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

src/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import http from "node:http"
55
import https from "node:https"
66
import path from "node:path"
77

8-
import compression from "compression"
98
import cors from "cors"
109
import express from "express"
1110
import type { Express, Request, Response } from "express"
@@ -32,11 +31,6 @@ const createServer = (domain = process.env["HOST"] || "localhost"): HttpsLocalho
3231
return app.server
3332
}
3433

35-
if (process.env["NODE_ENV"] === "production") {
36-
app.use(compression({ threshold: 1 }))
37-
app.set("json spaces", 0)
38-
}
39-
4034
app.redirect = function (httpPort = 80, httpsPort = Number(process.env["PORT"]) || 443) {
4135
app.http = http
4236
.createServer((req, res) => {

test/test.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ async function makeRequest(
6363
port: port,
6464
path: requestPath,
6565
method: "GET",
66-
headers: { "accept-encoding": "gzip" },
6766
ca: rootCA ? [rootCA] : undefined,
6867
agent: false,
6968
}
@@ -298,19 +297,3 @@ describe("Testing redirect", () => {
298297
})
299298
})
300299
})
301-
302-
// OTHER TESTS
303-
describe("Testing additional features", { timeout: 10000 }, () => {
304-
it("is ready for production", async () => {
305-
process.env["NODE_ENV"] = "production"
306-
app = createServer()
307-
app.serve("test", HTTPS_PORT)
308-
309-
await makeRequest("/static.html").then(res =>
310-
assert(res.headers["content-encoding"] === "gzip"),
311-
)
312-
await closeServer(app.server)
313-
delete process.env["NODE_ENV"]
314-
app = createServer()
315-
})
316-
})

0 commit comments

Comments
 (0)