Skip to content

Commit c004d4f

Browse files
committed
Compressed response should be base64 encoded
1 parent 58eac6e commit c004d4f

File tree

5 files changed

+3057
-8
lines changed

5 files changed

+3057
-8
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
"types": "./dist/compile/lambda.d.ts",
1515
"dependencies": {
1616
"binary-case": "^1.1.4",
17-
"in-process-request": "^0.0.3"
17+
"in-process-request": "^0.0.4"
1818
},
1919
"devDependencies": {
20+
"@types/compression": "^0.0.36",
2021
"@types/cookie-parser": "^1.4.1",
2122
"@types/express": "^4.17.0",
2223
"@types/jest": "^24.0.15",
2324
"@types/node": "^12.0.8",
25+
"compression": "^1.7.4",
2426
"cookie-parser": "^1.4.4",
2527
"ejs": "^2.6.2",
2628
"express": "^4.17.1",

test/app/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import express from 'express';
22
import path from 'path';
33
import cookieParser from 'cookie-parser';
4+
import compression from 'compression';
45

56
const app = express();
67

@@ -11,7 +12,7 @@ app.use(cookieParser());
1112
app.use(express.json());
1213
app.use(express.urlencoded({ extended: false }));
1314

14-
app.use("/static", express.static(path.join(__dirname, 'public')));
15+
app.use("/static", compression({}), express.static(path.join(__dirname, 'public')));
1516

1617
app.get('/render', (_, res) => {
1718
res.render('page');

0 commit comments

Comments
 (0)