Answer the question
In order to leave comments, you need to log in
How to get env variable?
Hello.
There is an env variable, on the command line, if you write it, echo $TEST,
it displays data.
I need to get this variable for endPoint in the application in order to make requests.
Can you please tell me how to get this variable, what to use it further on the frontend?
The app uses webpack and React
Answer the question
In order to leave comments, you need to log in
webpack.DefinePlugin
module.exports = {
plugins: [
new webpack.DefinePlugin({
__API_URL__: JSON.stringify(process.env.API_URL),
});
],
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question