turns out we simply use nitro.devProxy
.
At first hostRewrite
option seems to rewrite request header, but it actually rewrites host
field of the response header. So we need to manually pass headers
option.
https://github.com/http-party/node-http-proxy
const endpoint = 'https://api.example.com/graphql'
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({