Skip to content

Commit 3ed7080

Browse files
committed
Added dotenv section in configuration article
1 parent 4b06672 commit 3ed7080

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/v3/config/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,21 @@ const osjs = new Core(config, {
101101
omit: ['ws.port']
102102
});
103103
```
104+
105+
## Dotenv
106+
107+
You can provide configuration via a dotenv (`.env`) file to make make it dynamic.
108+
109+
This applies to both the client and the server
110+
111+
```
112+
OSJS_STANDALONE=true
113+
```
114+
115+
And in your `src/client/config.js` file:
116+
117+
```javascript
118+
{
119+
standalone: process.env.OSJS_STANDALONE === 'true'
120+
}
121+
```

0 commit comments

Comments
 (0)