diff --git a/README.md b/README.md index 4ebd244..d577278 100644 --- a/README.md +++ b/README.md @@ -90,4 +90,5 @@ You can self-host the API yourself, if you so wish! Here's the rough steps: You can pass these into the server as config (an `.env` file will **not** work): - `API_KEY`: A Google API key - see [this guide](https://theoephraim.github.io/node-google-spreadsheet/#/guides/authentication?id=api-key) to see how to get one hassle-free -- `PORT`: The HTTP port to host the server on \ No newline at end of file +- `PORT`: The HTTP port to host the server on +- `CACHE_DIR`: The directory to store cached data in, defaults to `./cache/` \ No newline at end of file diff --git a/index.js b/index.js index 6f53c90..f43db7a 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ import path from 'path'; import { request } from 'undici'; import PQueue from 'p-queue'; -const cacheFolder = './cache/'; +const cacheFolder = process.env.CACHE_DIR || './cache/'; let levels = { nlw: {