From 1b980682ec71e9c1997747c440a6ad14e31beaf9 Mon Sep 17 00:00:00 2001 From: schneefux Date: Mon, 7 May 2018 09:27:51 +0200 Subject: add npm data update script and brief readme --- README | 10 ++++++++++ backend/config.js | 4 ++-- package.json | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 README diff --git a/README b/README new file mode 100644 index 0000000..ceaad3b --- /dev/null +++ b/README @@ -0,0 +1,10 @@ +# brokentalents.fun + +## Setup + + * `npm install` + * create backend/secret.js as `module.exports.apikey = 'yourapikey';` or export the env var `API_KEY=""` + +## Updating the data + +`npm run backend` diff --git a/backend/config.js b/backend/config.js index cecbe05..dc13956 100644 --- a/backend/config.js +++ b/backend/config.js @@ -54,7 +54,7 @@ module.exports = { sum: ['Level', 'Winner'], }, file: { - pattern: (moment) => `../data/${hashSettings(module.exports)}/${moment.toISOString()}.json`, - reportPattern: () => `../data/${hashSettings(module.exports)}/report.json`, + pattern: (moment) => `./data/${hashSettings(module.exports)}/${moment.toISOString()}.json`, + reportPattern: () => `./data/${hashSettings(module.exports)}/report.json`, }, }; diff --git a/package.json b/package.json index 49ff23a..1f5f5fb 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,8 @@ }, "devDependencies": {}, "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\" && exit 1", + "backend": "node backend/index.js" }, "repository": { "type": "git", -- cgit v1.3.1