File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,10 @@ parent: Getting Started
77# Configuration
88
99Applications 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+ ```
You can’t perform that action at this time.
0 commit comments