koopjs / koop-provider-file-geojson

Simple Koop provider for serving file-based GeoJSON
Other
5 stars 6 forks source link

Conflicting environment variable names for data directory in docs and code? #7

Open maptastik opened 3 years ago

maptastik commented 3 years ago

In the documentation for this provider, the following instructions are offered for setting a custom data directory:

You can override this by setting an environment variable KOOP_DATA_DIR=.

After failing at this several times, I went to check out this provider's source code. src/model.js I found the following line where it appears the data directory is set:

const dataDir = koop.dataDir || process.env.DATA_DIR || './data'

When I changed the environment variable from KOOP_DATA_DIR to simply DATA_DIR, the provider finally worked. I am very new to working with NodeJS so I'm not super savvy at debugging, but from my understanding here, it looks like there is a conflict between the documentation and the actual code. Is this interpretation correct? If so, I'd be happy to either update the documentation or code.

rgwozdz commented 3 years ago

Hey, @maptastik. Nice catch, yes, one of these needs to be changed. Thanks!