Skip to content

Commit

Permalink
docs(env): cleanup the document (#3988)
Browse files Browse the repository at this point in the history
  • Loading branch information
AlphaWong authored and thonatos committed Oct 22, 2019
1 parent 2c5e64a commit 380e7d6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions docs/source/en/basics/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,13 @@ An web application itself should be stateless and has the ability to set its own

Egg has two ways to configure runtime environment:

1. Use `config/env` file, usually we use the build tools to generate this file, the content of this file is just the env value, such as `prod`.
2. use `EGG_SERVER_ENV` environment variable to configure.
1. Use `config/env` file, usually we use the build tools to generate this file, the content of this file is just an env value, such as `prod`.
```
// config/env
prod
```

The second way will be more commonly used, defining the runtime environment via `EGG_SERVER_ENV` when you start the application is more convenient, for example, use the code below to start the application in the production environment.
Defining the runtime environment via `EGG_SERVER_ENV` when you start the application is more convenient, for example, use the code below to start the application in the production environment.

```shell
EGG_SERVER_ENV=prod npm start
Expand Down
7 changes: 5 additions & 2 deletions docs/source/zh-cn/basics/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ title: 运行环境
框架有两种方式指定运行环境:

1. 通过 `config/env` 文件指定,该文件的内容就是运行环境,如 `prod`。一般通过构建工具来生成这个文件。
2. 通过 `EGG_SERVER_ENV` 环境变量指定。
```
// config/env
prod
```

其中,方式 2 比较常用,因为通过 `EGG_SERVER_ENV` 环境变量指定运行环境更加方便,比如在生产环境启动应用:
通过 `EGG_SERVER_ENV` 环境变量指定运行环境更加方便,比如在生产环境启动应用:

```shell
EGG_SERVER_ENV=prod npm start
Expand Down

0 comments on commit 380e7d6

Please sign in to comment.