vercel / serve-handler

The foundation of `serve`

Home Page:https://npmjs.com/serve-handler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

support runtime environment variables

AndyOGo opened this issue · comments

I want to serve a Create-React-App production build at different stages.

So I want to set all REACT_APP_ environment variables during runtime, not at build time.

In order to make this work I would like to utilize a tool similar to react-env, which creates a env.js file, which will hold all environment variables like:

window._env = { REACT_ENV_FOO: 'BAR' };

This can be archived by using a middleware