https://github.com/drivly/middleware
Edge Middleware Library for Hono and Itty Router
https://github.com/drivly/middleware
Last synced: 3 months ago
JSON representation
Edge Middleware Library for Hono and Itty Router
- Host: GitHub
- URL: https://github.com/drivly/middleware
- Owner: drivly
- License: mit
- Created: 2022-08-10T13:24:01.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-08-11T10:12:17.000Z (almost 3 years ago)
- Last Synced: 2025-02-16T15:16:58.434Z (3 months ago)
- Homepage: https://drivly.github.io/middleware
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Edge Middleware
Edge Middleware Library for Hono and Itty Router- Request metadata enrichment
- JWT Authentication
- API Key Authentication
- OAuth & Social Login
- Rate Limiting
- Crash Reporting
- CORS
- Logging
- Analytics
- Performance MeasurementThe pattern for Hono Middleware is:
```
export const poweredBy = () => {
return async (c: Context, next: Next) => {
await next()
c.res.headers.append('X-Powered-By', 'Hono')
}
}
```The pattern for Itty Router middleware is:
```
const requireUser = request => {
if (!request.user) {
return new Response('Not Authenticated', { status: 401 })
}
}
```