wobsoriano / nuxt-proxy

Http-proxy middleware for Nuxt 3.
MIT License
89 stars 8 forks source link

Page request stuck at "pending" #1

Closed odai-alali closed 2 years ago

odai-alali commented 2 years ago

After configuring the module as follows, it didn't work

export default defineNuxtConfig({
  modules: ['nuxt-proxy'],
  // See options here https://github.com/chimurai/http-proxy-middleware#options
  proxy: {
    target: 'http://localhost:8080',
    changeOrigin: true,
    pathRewrite: {
      '^/find/suchen/': ''
    },
    pathFilter: [
      '/find/suchen',
    ]
  },
}

There is no error log. Request is simply stuck at "pending"

wobsoriano commented 2 years ago

Would be nice to have a simple repro I can play with

wobsoriano commented 2 years ago

If you're using useFetch, you need to add a baseUrl

const baseUrl = 'http://localhost:3000'
const { data } = useFetch(`${baseUrl}/api/todos`)
wobsoriano commented 2 years ago

Feel free to open again