Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/fastify/fastify
/ rewriteUrl
Function
rewriteUrl
test/url-rewriting.test.js:9–13 ·
view source on GitHub ↗
(req)
Source
from the content-addressed store, hash-verified
7
t.plan(4)
8
const
fastify = Fastify({
9
rewriteUrl (req) {
10
t.assert.strictEqual(req.url,
'/this-would-404-without-url-rewrite'
)
11
this.log.info(
'rewriting url'
)
12
return
'/'
13
}
14
})
15
16
fastify.route({
Callers
nothing calls this directly
Calls
1
info
Method · 0.80
Tested by
no test coverage detected