Skip to content

Releases: wobsoriano/nuxt-proxy

v0.2.2

15 Jul 16:06

Choose a tag to compare

No significant changes

    View changes on GitHub

v0.2.1

15 Jul 04:10

Choose a tag to compare

   🚀 Features

  • deps: Bump @nuxt/kit from 3.0.0-rc.4 to 3.0.0-rc.5

v0.2.0

06 Jul 03:16

Choose a tag to compare

  • Supports multiple targets
export default defineNuxtConfig({
  modules: ['nuxt-proxy'],
  // See options here https://github.com/chimurai/http-proxy-middleware#options
  proxy: {
    options: [
      {
        target: 'https://jsonplaceholder.typicode.com',
        changeOrigin: true,
        pathRewrite: {
          '^/api/todos': '/todos'
        },
        pathFilter: [
          '/api/todos'
        ]
      },
      {
        target: 'https://api.spacexdata.com/v5',
        changeOrigin: true,
        pathRewrite: {
          '^/api/launches': '/launches/latest',
        },
        pathFilter: [
          '/api/launches',
        ],
      },
    ]
  }
})

// GET /api/todos -> https://jsonplaceholder.typicode.com/todos [304]
// GET /api/launches -> https://api.spacexdata.com/v5/launches/latest [304]