Skip to content
This repository was archived by the owner on Sep 25, 2020. It is now read-only.

Commit 8003acb

Browse files
committed
fix dcValue docs
1 parent 8a4a868 commit 8003acb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ type Keypath : String | Array<String>
5858
5959
zero-config := (dirname: String, opts?: {
6060
argv?: Array<String>,
61-
dc?: String,
61+
dcValue?: String,
6262
blackList?: Array<String>,
6363
env?: Object<String, String>,
6464
seed?: Object<String, Any>,
@@ -133,15 +133,14 @@ If you require `fetchConfig` anywhere else like `./api/server.js`
133133
**Note** that `opts` is only optional in environments other then
134134
`"production`". If your `process.env.NODE_ENV` is set to
135135
`"production"` then you **MUST** specifiy `opts` and specify
136-
the `opts.dc` parameter.
136+
the `opts.dcValue` parameter.
137137

138138
Running a production service without knowing how to load
139139
datacenter specific configuration is a bug.
140140

141-
#### `opts.dc`
141+
#### `opts.dcValue`
142142

143-
`opts.dc` is either `null` or a string path to a file that
144-
contains the name of the datacenter.
143+
`opts.dcValue` is either `null` or a datacenter name.
145144

146145
Say you have two datacenters, EC2-west and EC2-east. It's
147146
recommended that you have a file called `/etc/datacenter`
@@ -150,6 +149,9 @@ Say you have two datacenters, EC2-west and EC2-east. It's
150149
This way any service can know what datacenter it is running
151150
in with a simple `cat /etc/datacenter`.
152151

152+
You can then call `fetchConfig(...)` with the datacenter value
153+
by calling `fs.readFileSync('/etc/datacenter')`
154+
153155
Note that if you pass the dc config to `fetchConfig` then the
154156
config object will contain the `"datacenter"` key whose value
155157
is either `EC2-west` or `EC2-east` or whatever your datacenter

0 commit comments

Comments
 (0)