require() "beerchat.js" file in pwd for more flexibility (#56)

* require() "beerchat.js" file in pwd for more flexibility
* fix integration test
master
Buckaroo Banzai 2020-11-22 09:46:33 +01:00 committed by GitHub
parent 37844e6cf6
commit 654444d20b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 10 deletions

2
.gitignore vendored
View File

@ -1,3 +1,3 @@
node_modules
beerchat.json
beerchat.js
beerchat

View File

@ -10,7 +10,7 @@ docker network create beerchat
#TODO echo ${BEERCHAT_CONFIG} >> beerchat.json
docker run --name beerchat_proxy --rm \
-v $(pwd)/test/beerchat-test.json:/data/beerchat.json \
-v $(pwd)/test/beerchat-test.js:/data/beerchat.js \
--network beerchat \
beerchat_proxy &

View File

@ -19,9 +19,9 @@ curl -X POST \
## Configuration
beerchat.json
```json
{
beerchat.js
```js
module.exports = {
"debug": true,
"remotes": [{
@ -45,7 +45,7 @@ beerchat.json
"main": "test"
}
}]
}
};
```
## Starting

View File

@ -1,5 +1,4 @@
const fs = require('fs');
const cfg = JSON.parse(fs.readFileSync('beerchat.json', 'utf8'));
const cfg = require("../beerchat");
module.exports = cfg;

View File

@ -1,4 +1,4 @@
{
module.exports = {
"debug": true,
"remotes": []
}
};