mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 10:52:47 +00:00
updated bunch of file paths and changed the way posts are loaded
This commit is contained in:
90
node_modules/finalhandler/HISTORY.md
generated
vendored
Normal file
90
node_modules/finalhandler/HISTORY.md
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
0.4.0 / 2015-06-14
|
||||
==================
|
||||
|
||||
* Fix a false-positive when unpiping in Node.js 0.8
|
||||
* Support `statusCode` property on `Error` objects
|
||||
* Use `unpipe` module for unpiping requests
|
||||
* deps: escape-html@1.0.2
|
||||
* deps: on-finished@~2.3.0
|
||||
- Add defined behavior for HTTP `CONNECT` requests
|
||||
- Add defined behavior for HTTP `Upgrade` requests
|
||||
- deps: ee-first@1.1.1
|
||||
* perf: enable strict mode
|
||||
* perf: remove argument reassignment
|
||||
|
||||
0.3.6 / 2015-05-11
|
||||
==================
|
||||
|
||||
* deps: debug@~2.2.0
|
||||
- deps: ms@0.7.1
|
||||
|
||||
0.3.5 / 2015-04-22
|
||||
==================
|
||||
|
||||
* deps: on-finished@~2.2.1
|
||||
- Fix `isFinished(req)` when data buffered
|
||||
|
||||
0.3.4 / 2015-03-15
|
||||
==================
|
||||
|
||||
* deps: debug@~2.1.3
|
||||
- Fix high intensity foreground color for bold
|
||||
- deps: ms@0.7.0
|
||||
|
||||
0.3.3 / 2015-01-01
|
||||
==================
|
||||
|
||||
* deps: debug@~2.1.1
|
||||
* deps: on-finished@~2.2.0
|
||||
|
||||
0.3.2 / 2014-10-22
|
||||
==================
|
||||
|
||||
* deps: on-finished@~2.1.1
|
||||
- Fix handling of pipelined requests
|
||||
|
||||
0.3.1 / 2014-10-16
|
||||
==================
|
||||
|
||||
* deps: debug@~2.1.0
|
||||
- Implement `DEBUG_FD` env variable support
|
||||
|
||||
0.3.0 / 2014-09-17
|
||||
==================
|
||||
|
||||
* Terminate in progress response only on error
|
||||
* Use `on-finished` to determine request status
|
||||
|
||||
0.2.0 / 2014-09-03
|
||||
==================
|
||||
|
||||
* Set `X-Content-Type-Options: nosniff` header
|
||||
* deps: debug@~2.0.0
|
||||
|
||||
0.1.0 / 2014-07-16
|
||||
==================
|
||||
|
||||
* Respond after request fully read
|
||||
- prevents hung responses and socket hang ups
|
||||
* deps: debug@1.0.4
|
||||
|
||||
0.0.3 / 2014-07-11
|
||||
==================
|
||||
|
||||
* deps: debug@1.0.3
|
||||
- Add support for multiple wildcards in namespaces
|
||||
|
||||
0.0.2 / 2014-06-19
|
||||
==================
|
||||
|
||||
* Handle invalid status codes
|
||||
|
||||
0.0.1 / 2014-06-05
|
||||
==================
|
||||
|
||||
* deps: debug@1.0.2
|
||||
|
||||
0.0.0 / 2014-06-05
|
||||
==================
|
||||
|
||||
* Extracted from connect/express
|
||||
22
node_modules/finalhandler/LICENSE
generated
vendored
Normal file
22
node_modules/finalhandler/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
(The MIT License)
|
||||
|
||||
Copyright (c) 2014-2015 Douglas Christopher Wilson <doug@somethingdoug.com>
|
||||
|
||||
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.
|
||||
133
node_modules/finalhandler/README.md
generated
vendored
Normal file
133
node_modules/finalhandler/README.md
generated
vendored
Normal file
@@ -0,0 +1,133 @@
|
||||
# finalhandler
|
||||
|
||||
[![NPM Version][npm-image]][npm-url]
|
||||
[![NPM Downloads][downloads-image]][downloads-url]
|
||||
[![Node.js Version][node-image]][node-url]
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![Test Coverage][coveralls-image]][coveralls-url]
|
||||
|
||||
Node.js function to invoke as the final step to respond to HTTP request.
|
||||
|
||||
## Installation
|
||||
|
||||
```sh
|
||||
$ npm install finalhandler
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```js
|
||||
var finalhandler = require('finalhandler')
|
||||
```
|
||||
|
||||
### finalhandler(req, res, [options])
|
||||
|
||||
Returns function to be invoked as the final step for the given `req` and `res`.
|
||||
This function is to be invoked as `fn(err)`. If `err` is falsy, the handler will
|
||||
write out a 404 response to the `res`. If it is truthy, an error response will
|
||||
be written out to the `res`, and `res.statusCode` is set from `err.status`.
|
||||
|
||||
The final handler will also unpipe anything from `req` when it is invoked.
|
||||
|
||||
#### options.env
|
||||
|
||||
By default, the environment is determined by `NODE_ENV` variable, but it can be
|
||||
overridden by this option.
|
||||
|
||||
#### options.onerror
|
||||
|
||||
Provide a function to be called with the `err` when it exists. Can be used for
|
||||
writing errors to a central location without excessive function generation. Called
|
||||
as `onerror(err, req, res)`.
|
||||
|
||||
## Examples
|
||||
|
||||
### always 404
|
||||
|
||||
```js
|
||||
var finalhandler = require('finalhandler')
|
||||
var http = require('http')
|
||||
|
||||
var server = http.createServer(function (req, res) {
|
||||
var done = finalhandler(req, res)
|
||||
done()
|
||||
})
|
||||
|
||||
server.listen(3000)
|
||||
```
|
||||
|
||||
### perform simple action
|
||||
|
||||
```js
|
||||
var finalhandler = require('finalhandler')
|
||||
var fs = require('fs')
|
||||
var http = require('http')
|
||||
|
||||
var server = http.createServer(function (req, res) {
|
||||
var done = finalhandler(req, res)
|
||||
|
||||
fs.readFile('index.html', function (err, buf) {
|
||||
if (err) return done(err)
|
||||
res.setHeader('Content-Type', 'text/html')
|
||||
res.end(buf)
|
||||
})
|
||||
})
|
||||
|
||||
server.listen(3000)
|
||||
```
|
||||
|
||||
### use with middleware-style functions
|
||||
|
||||
```js
|
||||
var finalhandler = require('finalhandler')
|
||||
var http = require('http')
|
||||
var serveStatic = require('serve-static')
|
||||
|
||||
var serve = serveStatic('public')
|
||||
|
||||
var server = http.createServer(function (req, res) {
|
||||
var done = finalhandler(req, res)
|
||||
serve(req, res, done)
|
||||
})
|
||||
|
||||
server.listen(3000)
|
||||
```
|
||||
|
||||
### keep log of all errors
|
||||
|
||||
```js
|
||||
var finalhandler = require('finalhandler')
|
||||
var fs = require('fs')
|
||||
var http = require('http')
|
||||
|
||||
var server = http.createServer(function (req, res) {
|
||||
var done = finalhandler(req, res, {onerror: logerror})
|
||||
|
||||
fs.readFile('index.html', function (err, buf) {
|
||||
if (err) return done(err)
|
||||
res.setHeader('Content-Type', 'text/html')
|
||||
res.end(buf)
|
||||
})
|
||||
})
|
||||
|
||||
server.listen(3000)
|
||||
|
||||
function logerror(err) {
|
||||
console.error(err.stack || err.toString())
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](LICENSE)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/finalhandler.svg
|
||||
[npm-url]: https://npmjs.org/package/finalhandler
|
||||
[node-image]: https://img.shields.io/node/v/finalhandler.svg
|
||||
[node-url]: http://nodejs.org/download/
|
||||
[travis-image]: https://img.shields.io/travis/pillarjs/finalhandler.svg
|
||||
[travis-url]: https://travis-ci.org/pillarjs/finalhandler
|
||||
[coveralls-image]: https://img.shields.io/coveralls/pillarjs/finalhandler.svg
|
||||
[coveralls-url]: https://coveralls.io/r/pillarjs/finalhandler?branch=master
|
||||
[downloads-image]: https://img.shields.io/npm/dm/finalhandler.svg
|
||||
[downloads-url]: https://npmjs.org/package/finalhandler
|
||||
151
node_modules/finalhandler/index.js
generated
vendored
Normal file
151
node_modules/finalhandler/index.js
generated
vendored
Normal file
@@ -0,0 +1,151 @@
|
||||
/*!
|
||||
* finalhandler
|
||||
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
'use strict'
|
||||
|
||||
/**
|
||||
* Module dependencies.
|
||||
* @private
|
||||
*/
|
||||
|
||||
var debug = require('debug')('finalhandler')
|
||||
var escapeHtml = require('escape-html')
|
||||
var http = require('http')
|
||||
var onFinished = require('on-finished')
|
||||
var unpipe = require('unpipe')
|
||||
|
||||
/**
|
||||
* Module variables.
|
||||
* @private
|
||||
*/
|
||||
|
||||
/* istanbul ignore next */
|
||||
var defer = typeof setImmediate === 'function'
|
||||
? setImmediate
|
||||
: function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }
|
||||
var isFinished = onFinished.isFinished
|
||||
|
||||
/**
|
||||
* Module exports.
|
||||
* @public
|
||||
*/
|
||||
|
||||
module.exports = finalhandler
|
||||
|
||||
/**
|
||||
* Create a function to handle the final response.
|
||||
*
|
||||
* @param {Request} req
|
||||
* @param {Response} res
|
||||
* @param {Object} [options]
|
||||
* @return {Function}
|
||||
* @public
|
||||
*/
|
||||
|
||||
function finalhandler(req, res, options) {
|
||||
var opts = options || {}
|
||||
|
||||
// get environment
|
||||
var env = opts.env || process.env.NODE_ENV || 'development'
|
||||
|
||||
// get error callback
|
||||
var onerror = opts.onerror
|
||||
|
||||
return function (err) {
|
||||
var status = res.statusCode
|
||||
|
||||
// ignore 404 on in-flight response
|
||||
if (!err && res._header) {
|
||||
debug('cannot 404 after headers sent')
|
||||
return
|
||||
}
|
||||
|
||||
// unhandled error
|
||||
if (err) {
|
||||
// respect err.statusCode
|
||||
if (err.statusCode) {
|
||||
status = err.statusCode
|
||||
}
|
||||
|
||||
// respect err.status
|
||||
if (err.status) {
|
||||
status = err.status
|
||||
}
|
||||
|
||||
// default status code to 500
|
||||
if (!status || status < 400) {
|
||||
status = 500
|
||||
}
|
||||
|
||||
// production gets a basic error message
|
||||
var msg = env === 'production'
|
||||
? http.STATUS_CODES[status]
|
||||
: err.stack || err.toString()
|
||||
msg = escapeHtml(msg)
|
||||
.replace(/\n/g, '<br>')
|
||||
.replace(/ /g, ' ') + '\n'
|
||||
} else {
|
||||
status = 404
|
||||
msg = 'Cannot ' + escapeHtml(req.method) + ' ' + escapeHtml(req.originalUrl || req.url) + '\n'
|
||||
}
|
||||
|
||||
debug('default %s', status)
|
||||
|
||||
// schedule onerror callback
|
||||
if (err && onerror) {
|
||||
defer(onerror, err, req, res)
|
||||
}
|
||||
|
||||
// cannot actually respond
|
||||
if (res._header) {
|
||||
return req.socket.destroy()
|
||||
}
|
||||
|
||||
send(req, res, status, msg)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Send response.
|
||||
*
|
||||
* @param {IncomingMessage} req
|
||||
* @param {OutgoingMessage} res
|
||||
* @param {number} status
|
||||
* @param {string} body
|
||||
* @private
|
||||
*/
|
||||
|
||||
function send(req, res, status, body) {
|
||||
function write() {
|
||||
res.statusCode = status
|
||||
|
||||
// security header for content sniffing
|
||||
res.setHeader('X-Content-Type-Options', 'nosniff')
|
||||
|
||||
// standard headers
|
||||
res.setHeader('Content-Type', 'text/html; charset=utf-8')
|
||||
res.setHeader('Content-Length', Buffer.byteLength(body, 'utf8'))
|
||||
|
||||
if (req.method === 'HEAD') {
|
||||
res.end()
|
||||
return
|
||||
}
|
||||
|
||||
res.end(body, 'utf8')
|
||||
}
|
||||
|
||||
if (isFinished(req)) {
|
||||
write()
|
||||
return
|
||||
}
|
||||
|
||||
// unpipe everything from the request
|
||||
unpipe(req)
|
||||
|
||||
// flush the request
|
||||
onFinished(req, write)
|
||||
req.resume()
|
||||
}
|
||||
106
node_modules/finalhandler/package.json
generated
vendored
Normal file
106
node_modules/finalhandler/package.json
generated
vendored
Normal file
@@ -0,0 +1,106 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"finalhandler@0.4.0",
|
||||
"/home/mitchell/Desktop/test-mywebsite/mywebsite/node_modules/express"
|
||||
]
|
||||
],
|
||||
"_from": "finalhandler@0.4.0",
|
||||
"_id": "finalhandler@0.4.0",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/finalhandler",
|
||||
"_npmUser": {
|
||||
"email": "doug@somethingdoug.com",
|
||||
"name": "dougwilson"
|
||||
},
|
||||
"_npmVersion": "1.4.28",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "finalhandler",
|
||||
"raw": "finalhandler@0.4.0",
|
||||
"rawSpec": "0.4.0",
|
||||
"scope": null,
|
||||
"spec": "0.4.0",
|
||||
"type": "version"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/express"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-0.4.0.tgz",
|
||||
"_shasum": "965a52d9e8d05d2b857548541fb89b53a2497d9b",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "finalhandler@0.4.0",
|
||||
"_where": "/home/mitchell/Desktop/test-mywebsite/mywebsite/node_modules/express",
|
||||
"author": {
|
||||
"email": "doug@somethingdoug.com",
|
||||
"name": "Douglas Christopher Wilson"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/pillarjs/finalhandler/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"debug": "~2.2.0",
|
||||
"escape-html": "1.0.2",
|
||||
"on-finished": "~2.3.0",
|
||||
"unpipe": "~1.0.0"
|
||||
},
|
||||
"description": "Node.js final http responder",
|
||||
"devDependencies": {
|
||||
"istanbul": "0.3.15",
|
||||
"mocha": "2.2.5",
|
||||
"readable-stream": "2.0.0",
|
||||
"supertest": "1.0.1"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "965a52d9e8d05d2b857548541fb89b53a2497d9b",
|
||||
"tarball": "http://registry.npmjs.org/finalhandler/-/finalhandler-0.4.0.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
},
|
||||
"files": [
|
||||
"HISTORY.md",
|
||||
"LICENSE",
|
||||
"index.js"
|
||||
],
|
||||
"gitHead": "fe4e4de9ebb0f3831493ad75119ee6ba40542853",
|
||||
"homepage": "https://github.com/pillarjs/finalhandler",
|
||||
"license": "MIT",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "dougwilson",
|
||||
"email": "doug@somethingdoug.com"
|
||||
},
|
||||
{
|
||||
"name": "jongleberry",
|
||||
"email": "jonathanrichardong@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "tjholowaychuk",
|
||||
"email": "tj@vision-media.ca"
|
||||
},
|
||||
{
|
||||
"name": "fishrock123",
|
||||
"email": "fishrock123@rocketmail.com"
|
||||
},
|
||||
{
|
||||
"name": "defunctzombie",
|
||||
"email": "shtylman@gmail.com"
|
||||
}
|
||||
],
|
||||
"name": "finalhandler",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/pillarjs/finalhandler.git"
|
||||
},
|
||||
"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/"
|
||||
},
|
||||
"version": "0.4.0"
|
||||
}
|
||||
Reference in New Issue
Block a user