[英]I am having trouble of reading environment variable from azure app service configuration for my REACT app
I have added my variable in azure app service configuration and try to read it from my react application the following way, but no luck.我在 azure 应用程序服务配置中添加了我的变量,并尝试通过以下方式从我的反应应用程序中读取它,但没有运气。 Can anyone save the day?
谁能拯救这一天?
import React from 'react';
import './App.css';
function App() {
console.log(process.env);
return (
<div className="App">
<header className="App-header">
<h1>{process.env.REACT_APP_TITLE}</h1>
</header>
</div>
);
}
export default App;
This is my test code.这是我的测试代码。 I build project and deploy it in windows and linux.
我构建项目并将其部署在 windows 和 linux 中。
I found it not works, it should be a bug.我发现它不起作用,它应该是一个错误。 You can raise a support ticket to confirm it .
您可以提出支持票来确认。
Below is my test result.下面是我的测试结果。
Related Posts:相关文章:
In express project, it works for me, I have tested it before.在快递项目中,它对我有用,我之前已经测试过。
Retrieve Azure environment variables in NodeJs 在 NodeJs 中检索 Azure 环境变量
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.