Files
nightsurfer7 6e58cbea78 Minor typo correction (#29484)
The spelling of response had a typo.
2018-11-27 13:16:44 -08:00

25 lines
720 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Use the .env File
localeTitle: 使用.env文件
---
## 使用.env文件
我们可以使用.toUpperCase方法使字符串全部大写例如
```javascript
var response = "Hello World".toUpperCase(); // now becomes "HELLO WORLD"
```
我们现在需要做的就是检查环境变量的值是什么,你可以这样做:
```javascript
if (process.env.VAR_NAME === "allCaps") {
response = "Hello World".toUpperCase();
} else {
response = "Hello World";
}
});
```
[帮助我们的社区扩展这些提示和指南](https://github.com/freecodecamp/guides/tree/master/src/pages/certifications/apis-and-microservices/basic-node-and-express/use-the-.env-file/index.md) 。