Nuxt/examples/composables/use-fetch/server/api/hello.ts
Clément Ollivier 1a7b570c82
docs(examples): add examples to docs (#3966)
Co-authored-by: Pooya Parsa <pyapar@gmail.com>
2022-03-30 17:59:28 +02:00

8 lines
164 B
TypeScript

import { useQuery } from 'h3'
import { parseURL } from 'ufo'
export default req => ({
path: '/api/hello' + parseURL(req.url).pathname,
query: useQuery(req)
})