Files
2018-10-16 21:32:40 +05:30

24 lines
718 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") {
resonse = "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) 。