Comparing version 0.1.9 to 0.1.10
@@ -5,3 +5,3 @@ { | ||
"author": "Dav Glass <davglass@gmail.com>", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"devDependencies": { | ||
@@ -27,8 +27,3 @@ "vows": "*", | ||
}, | ||
"licenses": [ | ||
{ | ||
"type": "BSD", | ||
"url": "https://github.com/davglass/echoecho/blob/master/LICENSE" | ||
} | ||
], | ||
"license": "BSD-3-Clause", | ||
"repository": { | ||
@@ -35,0 +30,0 @@ "type": "git", |
@@ -69,6 +69,10 @@ EchoEcho | ||
In addition, when serving requests, you can specify an optional directory | ||
root within which `echoecho` can find the files to serve for customized | ||
responses by providing an object containing a `dirroot` | ||
key as the third argument to `serve`. | ||
Here's a simple example, assuming your tests serve from `/build/tests/mine/index.html` | ||
``` | ||
```js | ||
//Prepping once | ||
@@ -115,2 +119,23 @@ //Tell echoecho to serve from these base paths | ||
Handling all requests and serving from a different root: | ||
``` | ||
var ee = new require('echoecho').EchoEcho({ | ||
all: true | ||
}); | ||
// Can echoecho respond to this? | ||
if (echoecho.handle(req.url)) { | ||
// Pass in the request and response objects and echoecho will take it from here. | ||
// Specify the optional configuration for dirroot to use an alternate | ||
// base before the requested file. | ||
echoecho.serve(req, res, { | ||
dirroot: '/path/to/intended/root' | ||
}); | ||
} else { | ||
// throw your 404. | ||
} | ||
``` | ||
Using in Your Tests | ||
@@ -117,0 +142,0 @@ ------------------- |
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
50060
168