es6-dev-server
Advanced tools
Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "es6-dev-server", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"bin": { | ||
@@ -5,0 +5,0 @@ "es6-dev-server": "./server" |
@@ -5,2 +5,4 @@ # Serve ES6 modules | ||
Resolution is done via the node algorithm, but letting "module" or "jsnext" fields in package.json take precedence over "main". | ||
## Usage as a stand alone server | ||
@@ -34,3 +36,3 @@ | ||
app.use(moduleMiddleware('.')) | ||
... | ||
```` | ||
@@ -46,1 +48,13 @@ The parameter is the directory that will be served. | ||
```` | ||
const ModuleMiddleware = require('es6-dev-server').ModuleMiddleware | ||
const mm = new ModuleMiddleware({ root }) | ||
app.use((req, res, next) => { | ||
if (mm.handleRequest(req, res)) { | ||
// The request WAS handled by the middleware's handleRequest() function | ||
} else { | ||
// The request was NOT handled by the middleware's handleRequest() function | ||
next() | ||
} | ||
}) | ||
```` |
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
44586
58