ETag Middleware
Using this middleware, you can add ETag headers easily.
Import
ts
import { Hono } from 'hono'
import { etag } from 'hono/etag'
import { Hono } from 'hono'
import { etag } from 'hono/etag'
ts
import { Hono } from 'https://deno.land/x/hono/mod.ts'
import { etag } from 'https://deno.land/x/hono/middleware.ts'
import { Hono } from 'https://deno.land/x/hono/mod.ts'
import { etag } from 'https://deno.land/x/hono/middleware.ts'
Usage
ts
const app = new Hono()
app.use('/etag/*', etag())
app.get('/etag/abc', (c) => {
return c.text('Hono is cool')
})
const app = new Hono()
app.use('/etag/*', etag())
app.get('/etag/abc', (c) => {
return c.text('Hono is cool')
})
Options
weak
: boolean- Define using or not using a weak validation. If
true
is set, thenw/
is added to the prefix of the value. Default isfalse
.
- Define using or not using a weak validation. If