wobsoriano / nuxt-proxy

Http-proxy middleware for Nuxt 3.
MIT License
92 stars 9 forks source link

[Feature]: Multiple Targets #2

Closed Blemming closed 2 years ago

Blemming commented 2 years ago

Is it possible to have multiple proxy targets using this module ?

In the nuxt 2 proxy module, the proxy option takes either an array of configs or an object. ie:

export default defineNuxtConfig({
  proxy:[
    {
      target: 'http://api1.domain.com',
      pathFilter: [
        '/api/v1/**'
      ]
    },
    {
      target: 'http://api2.domain.com',
      pathFilter: [
        '/api/v2/**'
      ]
    }
  ]
})
wobsoriano commented 2 years ago

You are right, this module only accepts a single target. I’ll add that feature.

wobsoriano commented 2 years ago

https://github.com/wobsoriano/nuxt-proxy/releases/tag/v0.2.0