Cache redirects for 5 mins
This commit is contained in:
parent
b7aff74b46
commit
d452d57d86
|
@ -6,11 +6,12 @@
|
||||||
"config": {
|
"config": {
|
||||||
"registryURL": "https://registry.npmjs.org",
|
"registryURL": "https://registry.npmjs.org",
|
||||||
"bowerBundle": "/bower.zip",
|
"bowerBundle": "/bower.zip",
|
||||||
|
"redirectTTL": 500,
|
||||||
"port": 5000
|
"port": 5000
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cors": "^2.7.1",
|
"cors": "^2.7.1",
|
||||||
"express": "^4.13.4",
|
"express": "^4.13.4",
|
||||||
"npm-http-server": "^2.3.1"
|
"npm-http-server": "^2.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,7 @@ const cors = require('cors')
|
||||||
|
|
||||||
const registryURL = process.env.npm_package_config_registryURL
|
const registryURL = process.env.npm_package_config_registryURL
|
||||||
const bowerBundle = process.env.npm_package_config_bowerBundle
|
const bowerBundle = process.env.npm_package_config_bowerBundle
|
||||||
|
const redirectTTL = process.env.npm_package_config_redirectTTL
|
||||||
const port = process.env.PORT || process.env.npm_package_config_port
|
const port = process.env.PORT || process.env.npm_package_config_port
|
||||||
const app = express()
|
const app = express()
|
||||||
|
|
||||||
|
@ -12,7 +13,8 @@ app.use(cors())
|
||||||
app.use(express.static('public', { maxAge: 60000 }))
|
app.use(express.static('public', { maxAge: 60000 }))
|
||||||
app.use(createRequestHandler({
|
app.use(createRequestHandler({
|
||||||
registryURL: registryURL,
|
registryURL: registryURL,
|
||||||
bowerBundle: bowerBundle
|
bowerBundle: bowerBundle,
|
||||||
|
redirectTTL: redirectTTL
|
||||||
}))
|
}))
|
||||||
|
|
||||||
app.listen(port, function () {
|
app.listen(port, function () {
|
||||||
|
|
Loading…
Reference in New Issue