Comparing version 0.1.0 to 0.1.1
@@ -65,3 +65,3 @@ const fs = require('fs'); | ||
let data = find(pathname, extensions); | ||
if (!data) return (next || notFound)(res); | ||
if (!data) return next ? next() : notFound(res); | ||
@@ -68,0 +68,0 @@ res.writeHead(200, data.headers); |
{ | ||
"name": "sirv", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "The optimized & lightweight middleware for serving requests to static assets", | ||
@@ -5,0 +5,0 @@ "repository": "lukeed/sirv", |
@@ -51,3 +51,3 @@ # sirv [![Build Status](https://travis-ci.org/lukeed/sirv.svg?branch=master)](https://travis-ci.org/lukeed/sirv) | ||
For `sirv`, the `next()` callback is functionally synonymous with [`opts.onNoMatch`](#optsonnomatch); however `next()` is given priority if/when defined. | ||
For `sirv`, the `next()` callback is functionally synonymous with [`opts.onNoMatch`](#optsonnomatch); however `next()` is given priority if/when defined and **will not** receive the `res` as an argument. | ||
@@ -97,7 +97,7 @@ #### dir | ||
A custom function to run if a file cannot be found for a given request. By default, `sirv` will send a basic `(404) Not found` response. | ||
A custom function to run if a file cannot be found for a given request. <br>By default, `sirv` will send a basic `(404) Not found` response. | ||
The function receives the current `res <ServerResponse>` as its only argument. | ||
> **Note:** This can only be replaced if a `next` callback has been provided to the middleware; see [`sirv`](#sirvdir-opts) description. | ||
> **Note:** This won't run if a `next` callback has been provided to the middleware; see [`sirv`](#sirvdir-opts) description. | ||
@@ -104,0 +104,0 @@ #### opts.setHeaders |
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
6930