Nitro Api
createSitePathResolver()
Last updated by
Harlan Wilton
in docs: broken links. Same as createSitePathResolver() but you will need to provide the request context.
Usage
serverMiddleware.ts
import { createSitePathResolver } from '#imports'
export default defineEventHandler((e) => {
const resolvePath = createSitePathResolver(e, {
canonical: true,
})
resolvePath('/about')
// https://www.example.com/about
})
Did this page help you?