nuxt-community / proxy-module

The one-liner node.js http-proxy middleware solution for Nuxt 2 using http-proxy-middleware
MIT License
413 stars 26 forks source link

Allow nuxt runtime config #83

Closed srbarba closed 3 years ago

srbarba commented 3 years ago

What problem does this feature solve?

Proxy module is configured in buildtime, so you can not use env variables expecting to change on runtime.

What does the proposed changes look like?

Nuxt has runtime config support since v2.13: https://nuxtjs.org/blog/moving-from-nuxtjs-dotenv-to-runtime-config

Axios module already use runtime config: https://github.com/nuxt-community/axios-module/blob/master/lib/module.js#L14

I suggest to do it the way axios module do it to allow proxy module works with runtime config.

This feature request is available on Nuxt community (#c52)