Skip to content

Commit 4de9d41

Browse files
committed
docs(get-started): select environment
1 parent ba97ad6 commit 4de9d41

File tree

1 file changed

+22
-4
lines changed

1 file changed

+22
-4
lines changed

get-started/configuration.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ parent: Getting Started
77
# Configuration
88

99
Applications often need to be configured to run in different environments. For example, you might want to use a
10-
different database in development than in production. Configuration is a way to set up your application to run in
11-
different environments.
10+
different database in development than in production.
1211

13-
Thanks to (dotenv)[https://www.npmjs.com/package/dotenv], KoalaTs provides a powerful way to manage your application
14-
configuration.
12+
Thanks to [dotenv](https://www.npmjs.com/package/dotenv), **KoalaTs 🐨** provides a powerful way to manage your
13+
application configuration.
1514

1615
## Environment files
1716

@@ -50,3 +49,22 @@ Several other .env files are available to set environment variables in just the
5049
are committed);
5150
- `.env.<environment>.local` (e.g. `.env.test.local`): defines machine-specific env var overrides only for one
5251
environment. It's similar to `.env.local`, but the overrides only apply to one environment.
52+
53+
## Selecting the environment
54+
55+
The environment is selected by the `NODE_ENV` environment variable. If you don't set it, the default value is
56+
`development`. You can set it before running your application:
57+
58+
```bash
59+
NODE_ENV=production npm start
60+
```
61+
62+
Or in your `package.json` scripts:
63+
64+
```json
65+
{
66+
"scripts": {
67+
"start": "NODE_ENV=production node dist/index.js"
68+
}
69+
}
70+
```

0 commit comments

Comments
 (0)