1 | # Config
|
2 | Isomorphic app config.
|
3 |
|
4 | **Why?** — we use [node-config](https://github.com/lorenwest/node-config)
|
5 | for convenient configuration of our apps. `node-config` itself works in NodeJS
|
6 | environment only. This utility exposes the config in isomorphic way that works
|
7 | both at server- and client-side.
|
8 |
|
9 | Use it this way:
|
10 | ```js
|
11 | import { config } from 'topcoder-react-utils';
|
12 |
|
13 | // Some code relying on the config.
|
14 | ```
|
15 |
|
16 | Keep in mind that config still can be different at client- and server-side, due
|
17 | to normalization during injection into the HTML page template:
|
18 | - Some sensitive config params can be trimmed out of the injected config (by
|
19 | default we remove `SECRET` key);
|
20 | - Some extra data can be appended to the config, anything that does not come
|
21 | from `node-config`, and is not stored in Redux state (although, most probably,
|
22 | it should be), but still should be transmitted to the client side and be
|
23 | available inside JS.
|