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