Skip to content

Commit

Permalink
feat: use config in root app directory
Browse files Browse the repository at this point in the history
BREAKING CHANGE: configuration files must now be mounted at
`/opt/arena/index.json` instead of
`/opt/arena/src/server/config/index.json`. Failure to do so will result
in Arena starting with an empty config.
  • Loading branch information
Eli Skeggs committed Aug 4, 2020
1 parent 9ef953e commit c9b4d44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ $ docker build -t <name-image> .
To run a container, execute the following command. Note that we need to settle the location of `index.json` in this container via volume mounting:

```shell
$ docker run -p 4567:4567 -v </local/route/to/index.json>:/opt/arena/node_modules/bull-arena/src/server/config/index.json <name-image>
$ docker run -p 4567:4567 -v </local/route/to/index.json>:/opt/arena/index.json <name-image>
```

See [the docs][usage] for `index.json`.
Expand Down
11 changes: 10 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
const Arena = require('bull-arena');

Arena();
let config;
try {
config = require('./index.json');
} catch (err) {
if (err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
}

Arena(config);

0 comments on commit c9b4d44

Please sign in to comment.