@unleash/proxy
Advanced tools
Comparing version 0.3.2 to 0.4.0
# Changelog | ||
### 0.4.0 | ||
- feat: add compression #23 | ||
### 0.3.2 | ||
@@ -29,2 +32,2 @@ - fix: perform build before publish! | ||
- fix: require app instead of index. | ||
- fix: Update README.md | ||
- fix: Update README.md |
@@ -7,2 +7,3 @@ "use strict"; | ||
exports.createApp = void 0; | ||
const compression_1 = __importDefault(require("compression")); | ||
const express_1 = __importDefault(require("express")); | ||
@@ -15,3 +16,3 @@ const cors_1 = __importDefault(require("cors")); | ||
exposedHeaders: 'ETag', | ||
maxAge: 604800, | ||
maxAge: 172800, | ||
}; | ||
@@ -25,2 +26,3 @@ function createApp(options, unleashClient, app = express_1.default()) { | ||
app.use(cors_1.default(corsOptions)); | ||
app.use(compression_1.default()); | ||
app.use(`${config.proxyBasePath}/proxy`, cors_1.default(corsOptions), express_1.default.json(), proxy.middleware); | ||
@@ -27,0 +29,0 @@ return app; |
{ | ||
"name": "@unleash/proxy", | ||
"version": "0.3.2", | ||
"version": "0.4.0", | ||
"description": "The Unleash Proxy (Open-Source)", | ||
@@ -33,2 +33,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"compression": "^1.7.4", | ||
"cors": "^2.8.5", | ||
@@ -40,2 +41,3 @@ "express": "^4.17.1", | ||
"devDependencies": { | ||
"@types/compression": "^1.7.1", | ||
"@types/cors": "^2.8.10", | ||
@@ -42,0 +44,0 @@ "@types/express": "^4.17.12", |
@@ -0,1 +1,2 @@ | ||
import compression from 'compression'; | ||
import express, { Application } from 'express'; | ||
@@ -10,3 +11,3 @@ import cors from 'cors'; | ||
exposedHeaders: 'ETag', | ||
maxAge: 604800, | ||
maxAge: 172800, | ||
}; | ||
@@ -27,2 +28,5 @@ | ||
app.use(cors(corsOptions)); | ||
app.use(compression()); | ||
app.use( | ||
@@ -29,0 +33,0 @@ `${config.proxyBasePath}/proxy`, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
137695
2440
5
18
+ Addedcompression@^1.7.4
+ Addedcompressible@2.0.18(transitive)
+ Addedcompression@1.7.5(transitive)
+ Addedmime-db@1.53.0(transitive)
+ Addednegotiator@0.6.4(transitive)
+ Addedon-headers@1.0.2(transitive)