Comparing version 0.0.7 to 0.0.8
{ | ||
"name": "hono", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"description": "Minimal web framework for Cloudflare Workers and Fastly Compute@Edge", | ||
@@ -5,0 +5,0 @@ "main": "src/hono.js", |
@@ -105,3 +105,16 @@ # Hono | ||
### Builtin Middleware | ||
```js | ||
const { Hono, Middleware } = require('hono') | ||
... | ||
app.use('*', Middleware.poweredBy) | ||
``` | ||
### Custom Middleware | ||
```js | ||
const logger = (c, next) => { | ||
@@ -117,4 +130,4 @@ console.log(`[${c.req.method}] ${c.req.url}`) | ||
app = app.use('*', logger) | ||
app = app.use('/message/*', addHeader) | ||
app.use('*', logger) | ||
app.use('/message/*', addHeader) | ||
@@ -121,0 +134,0 @@ app.get('/message/hello', () => 'Hello Middleware!') |
@@ -42,2 +42,7 @@ declare class FetchEvent {} | ||
export class Middleware {} | ||
// XXX | ||
declare interface BuiltinMiddleware {} | ||
export class Middleware { | ||
static poweredBy: BuiltinMiddleware | ||
} |
@@ -1,3 +0,7 @@ | ||
class Middleware {} | ||
const poweredBy = require('./middleware/poweredBy') | ||
function Middleware() {} | ||
Middleware.poweredBy = poweredBy | ||
module.exports = Middleware |
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
26374
20
714
191
20