Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds nocache middleware #244

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var express = require('express')
var Error = require('http-errors')
var compression = require('compression')
var nocache = require('nocache')
var Auth = require('./auth')
var Logger = require('./logger')
var Config = require('./config')
Expand Down Expand Up @@ -45,6 +46,7 @@ module.exports = function(config_hash) {
}

app.use(Middleware.log)
app.use(nocache())
app.use(error_reporting_middleware)
app.use(function(req, res, next) {
res.setHeader('X-Powered-By', config.user_agent)
Expand Down
4 changes: 4 additions & 0 deletions npm-shrinkwrap.json

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

89 changes: 89 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"name": "sinopia",
"version": "1.2.2",
"description": "Private npm repository server",
"author": {
"name": "Alex Kocharin",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "git://github.com/rlidwka/sinopia"
},
"main": "index.js",
"bin": {
"sinopia": "./bin/sinopia"
},
"dependencies": {
"express": ">=5.0.0-0 <6.0.0-0",
"express-json5": ">=0.1.0 <1.0.0-0",
"body-parser": ">=1.9.2 <2.0.0-0",
"compression": ">=1.2.0 <2.0.0-0",
"commander": ">=2.3.0 <3.0.0-0",
"js-yaml": ">=3.0.1 <4.0.0-0",
"cookies": ">=0.5.0 <1.0.0-0",
"request": ">=2.31.0 <3.0.0-0",
"async": ">=0.9.0 <1.0.0-0",
"es6-shim": "0.21.x",
"semver": ">=2.2.1 <5.0.0-0",
"minimatch": ">=0.2.14 <2.0.0-0",
"bunyan": ">=0.22.1 <2.0.0-0",
"handlebars": "2.x",
"highlight.js": "8.x",
"lunr": ">=0.5.2 <1.0.0-0",
"render-readme": ">=0.2.1",
"jju": "1.x",
"mkdirp": ">=0.3.5 <1.0.0-0",
"sinopia-htpasswd": ">= 0.4.3",
"http-errors": ">=1.2.0",
"nocache": ">=0.3.0 <1.0.0.0-0"
},
"optionalDependencies": {
"fs-ext": ">=0.4.1 <1.0.0-0",
"crypt3": ">=0.1.6 <1.0.0-0"
},
"devDependencies": {
"rimraf": ">=2.2.5 <3.0.0-0",
"bluebird": "2 >=2.9",
"mocha": "2 >=2.2.3",
"eslint": ">= 0.18",
"browserify": "7.x",
"browserify-handlebars": "1.x",
"grunt": ">=0.4.4 <1.0.0-0",
"grunt-cli": "*",
"grunt-browserify": ">=2.0.8 <3.0.0-0",
"grunt-contrib-less": ">=0.11.0 <1.0.0-0",
"grunt-contrib-watch": ">=0.6.1 <1.0.0-0",
"unopinionate": ">=0.0.4 <1.0.0-0",
"onclick": ">=0.1.0 <1.0.0-0",
"transition-complete": ">=0.0.2 <1.0.0-0"
},
"keywords": [
"private",
"package",
"repository",
"registry",
"modules",
"proxy",
"server"
],
"scripts": {
"test": "eslint --reset . && mocha ./test/functional ./test/unit",
"test-travis": "eslint --reset . && mocha -R spec ./test/functional ./test/unit",
"test-only": "mocha ./test/functional ./test/unit",
"lint": "eslint --reset .",
"prepublish": "js-yaml package.yaml > package.json",
"clean-shrinkwrap": "node -e '\n function clean(j) {\n if (!j) return\n for (var k in j) {\n delete j[k].from\n delete j[k].resolved\n if (j[k].dependencies) clean(j[k].dependencies)\n }\n }\n x = JSON.parse(require(\"fs\").readFileSync(\"./npm-shrinkwrap.json\"))\n clean(x.dependencies)\n x = JSON.stringify(x, null, \" \")\n require(\"fs\").writeFileSync(\"./npm-shrinkwrap.json\", x + \"\\n\")\n'\n"
},
"engines": {
"node": ">=0.10"
},
"preferGlobal": true,
"publishConfig": {
"registry": "https://registry.npmjs.org/"
},
"license": {
"type": "WTFPL",
"url": "http://www.wtfpl.net/txt/copying/"
}
}
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ dependencies:
express-json5: '>=0.1.0 <1.0.0-0'
body-parser: '>=1.9.2 <2.0.0-0'
compression: '>=1.2.0 <2.0.0-0'
nocache: '>=0.3.0 <1.0.0-0'

commander: '>=2.3.0 <3.0.0-0'
js-yaml: '>=3.0.1 <4.0.0-0'
Expand Down