Sunday, May 10, 2015 at 7:41 AM

New way to configure River4

New in River4 v0.110.

I had to switch from Heroku to an AWS-hosted Ubuntu server that's hosting a bunch of other apps. Without the isolation that Heroku provides, the environment variables of all these apps were getting in each others' way. Rather than hack my way through all the arcane rules of environment variables, I decided to create a simpler more reliable (imho) way to configure River4 and nodeStorage, using a config.json file in the same directory as river4.js.

What's in config.json

Here's a list of values you can include in this file:

  1. fspath

  2. password

  3. s3path

  4. PORT

  5. s3defaultAcl

They work exactly the same way as the environment variables with the same names.

If you specify an environment variable and an element in config.json, the one in config.json takes precedence.

Three exceptions

If you're using S3 storage, you need to provide the three values for your AWS account. Since the Amazon library is looking for these in environment variables, you must provide them that way.





Here's an example, the contents of config.json on my server (with values changed).

A picture named config.png

Last built: Mon, Jul 20, 2015 at 10:21 AM

By Dave Winer, Sunday, May 10, 2015 at 7:41 AM. Welcome back my friends to the show that never ends.