Started on node.js+socket.io+mongoDB on the backend for more responsivnes

This commit is contained in:
KasperRT
2015-04-09 00:18:13 +02:00
parent 076f8e821f
commit a8a705bd77
1889 changed files with 322175 additions and 68 deletions

3
server/node_modules/express/node_modules/vary/.npmignore generated vendored Executable file
View File

@@ -0,0 +1,3 @@
coverage/
test/
.travis.yml

16
server/node_modules/express/node_modules/vary/History.md generated vendored Executable file
View File

@@ -0,0 +1,16 @@
1.0.0 / 2014-08-10
==================
* Accept valid `Vary` header string as `field`
* Add `vary.append` for low-level string manipulation
* Move to `jshttp` orgainzation
0.1.0 / 2014-06-05
==================
* Support array of fields to set
0.0.0 / 2014-06-04
==================
* Initial release

22
server/node_modules/express/node_modules/vary/LICENSE generated vendored Executable file
View File

@@ -0,0 +1,22 @@
(The MIT License)
Copyright (c) 2014 Douglas Christopher Wilson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

59
server/node_modules/express/node_modules/vary/README.md generated vendored Executable file
View File

@@ -0,0 +1,59 @@
# vary
[![NPM Version](http://img.shields.io/npm/v/vary.svg?style=flat)](https://www.npmjs.org/package/vary)
[![Node.js Version](http://img.shields.io/badge/node.js->=_0.8-blue.svg?style=flat)](http://nodejs.org/download/)
[![Build Status](http://img.shields.io/travis/jshttp/vary.svg?style=flat)](https://travis-ci.org/jshttp/vary)
[![Coverage Status](https://img.shields.io/coveralls/jshttp/vary.svg?style=flat)](https://coveralls.io/r/jshttp/vary)
[![Gittip](http://img.shields.io/gittip/dougwilson.svg?style=flat)](https://www.gittip.com/dougwilson/)
Manipulate the HTTP Vary header
## Install
```sh
$ npm install vary
```
## API
```js
var vary = require('vary')
```
### vary(res, field)
Adds the given header `field` to the `Vary` response header of `res`.
This can be a string of a single field, a string of a valid `Vary`
header, or an array of multiple fields.
This will append the header if not already listed, otherwise leaves
it listed in the current location.
```js
// Append "Origin" to the Vary header of the response
vary(res, 'Origin')
```
### vary.append(header, field)
Adds the given header `field` to the `Vary` response header string `header`.
This can be a string of a single field, a string of a valid `Vary` header,
or an array of multiple fields.
This will append the header if not already listed, otherwise leaves
it listed in the current location. The new header string is returned.
```js
// Get header string appending "Origin" to "Accept, User-Agent"
vary.append('Accept, User-Agent', 'Origin')
```
## Testing
```sh
$ npm test
```
## License
[MIT](LICENSE)

112
server/node_modules/express/node_modules/vary/index.js generated vendored Executable file
View File

@@ -0,0 +1,112 @@
/*!
* vary
* Copyright(c) 2014 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* Module exports.
*/
module.exports = vary;
module.exports.append = append;
/**
* Variables.
*/
var separators = /[\(\)<>@,;:\\"\/\[\]\?=\{\}\u0020\u0009]/;
/**
* Append a field to a vary header.
*
* @param {String} header
* @param {String|Array} field
* @return {String}
* @api public
*/
function append(header, field) {
if (typeof header !== 'string') {
throw new TypeError('header argument is required');
}
if (!field) {
throw new TypeError('field argument is required');
}
// get fields array
var fields = !Array.isArray(field)
? parse(String(field))
: field;
// assert on invalid fields
for (var i = 0; i < fields.length; i++) {
if (separators.test(fields[i])) {
throw new TypeError('field argument contains an invalid header');
}
}
// existing, unspecified vary
if (header === '*') {
return header;
}
// enumerate current values
var vals = parse(header.toLowerCase());
// unspecified vary
if (fields.indexOf('*') !== -1 || vals.indexOf('*') !== -1) {
return '*';
}
for (var i = 0; i < fields.length; i++) {
field = fields[i].toLowerCase();
// append value (case-preserving)
if (vals.indexOf(field) === -1) {
vals.push(field);
header = header
? header + ', ' + fields[i]
: fields[i];
}
}
return header;
}
/**
* Parse a vary header into an array.
*
* @param {String} header
* @return {Array}
* @api private
*/
function parse(header) {
return header.trim().split(/ *, */);
}
/**
* Mark that a request is varied on a header field.
*
* @param {Object} res
* @param {String|Array} field
* @api public
*/
function vary(res, field) {
if (!res || !res.getHeader || !res.setHeader) {
// quack quack
throw new TypeError('res argument is required');
}
// get existing header
var val = res.getHeader('Vary') || ''
var header = Array.isArray(val)
? val.join(', ')
: String(val);
// set new header
res.setHeader('Vary', append(header, field));
}

71
server/node_modules/express/node_modules/vary/package.json generated vendored Executable file
View File

@@ -0,0 +1,71 @@
{
"name": "vary",
"description": "Manipulate the HTTP Vary header",
"version": "1.0.0",
"author": {
"name": "Douglas Christopher Wilson",
"email": "doug@somethingdoug.com"
},
"license": "MIT",
"keywords": [
"http",
"res",
"vary"
],
"repository": {
"type": "git",
"url": "https://github.com/jshttp/vary"
},
"devDependencies": {
"istanbul": "0.3.0",
"mocha": "~1.21.4",
"should": "~4.0.4",
"supertest": "~0.13.0"
},
"engines": {
"node": ">= 0.8.0"
},
"scripts": {
"test": "mocha --reporter spec --bail --check-leaks test/",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/",
"test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/"
},
"gitHead": "56acecd9fa20888132563b00576625ea02a69a35",
"bugs": {
"url": "https://github.com/jshttp/vary/issues"
},
"homepage": "https://github.com/jshttp/vary",
"_id": "vary@1.0.0",
"_shasum": "c5e76cec20d3820d8f2a96e7bee38731c34da1e7",
"_from": "vary@~1.0.0",
"_npmVersion": "1.4.21",
"_npmUser": {
"name": "dougwilson",
"email": "doug@somethingdoug.com"
},
"maintainers": [
{
"name": "dougwilson",
"email": "doug@somethingdoug.com"
},
{
"name": "jongleberry",
"email": "jonathanrichardong@gmail.com"
},
{
"name": "fishrock123",
"email": "fishrock123@rocketmail.com"
},
{
"name": "shtylman",
"email": "shtylman@gmail.com"
}
],
"dist": {
"shasum": "c5e76cec20d3820d8f2a96e7bee38731c34da1e7",
"tarball": "http://registry.npmjs.org/vary/-/vary-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/vary/-/vary-1.0.0.tgz",
"readme": "ERROR: No README data found!"
}