How do I load multiple configuration files?

I'm looking for a crate to load MANY configuration variables for my app.

(I know dotenv but it seems it is not very suitable for multiple files. dotenv seems to be only for 1 file)

I have these files:

/usr/local/myapp/east-server.conf -
IP_ADDRESS=123.123.123.123
PORT=11111

/usr/local/myapp/north-server.conf -
IP_ADDRESS=124.124.124.124
PORT=22222

/usr/local/myapp/west-server.conf -
IP_ADDRESS=125.125.125.125
PORT=33333

Requirements:-

  • All config files are in the same directory.
  • All config files have different names
  • ALL variables have the same keys (ie. IP_ADDRESS and ).

What crates do you recommend?

serde + toml?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.