reactjs - Get env file values from a liferay's react module - Stack Overflow

admin2025-04-15  0

I'm starting to use Liferay in a project and just created a React Module that has to fetch some API content after being authorised.

I could just hardcode user and password inside the component it will just be visible for everyone that could examine the page. I then decided to install dotenv as a dependency of my module and then crate a .env file with some data to play with beforehand.

I can't make it to work. So, TL;DR: is it possible to access some .env file in a Liferay React Module?

转载请注明原文地址:http://www.anycun.com/QandA/1744716432a86633.html