mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
backend: Add config file env var
This commit is contained in:
parent
9047cb5998
commit
8f0fc3af57
2 changed files with 9 additions and 2 deletions
|
|
@ -110,6 +110,11 @@ Run the Mempool backend:
|
|||
|
||||
```
|
||||
npm run start
|
||||
|
||||
```
|
||||
You can also set env var `MEMPOOL_CONFIG_FILE` to specify a custom config file location:
|
||||
```
|
||||
MEMPOOL_CONFIG_FILE=/path/to/mempool-config.json npm run start
|
||||
```
|
||||
|
||||
When it's running, you should see output like this:
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
const configFile = require('../mempool-config.json');
|
||||
const configFromFile = require(
|
||||
process.env.MEMPOOL_CONFIG_FILE ? process.env.MEMPOOL_CONFIG_FILE : '../mempool-config.json'
|
||||
);
|
||||
|
||||
interface IConfig {
|
||||
MEMPOOL: {
|
||||
|
|
@ -249,7 +251,7 @@ class Config implements IConfig {
|
|||
MAXMIND: IConfig['MAXMIND'];
|
||||
|
||||
constructor() {
|
||||
const configs = this.merge(configFile, defaults);
|
||||
const configs = this.merge(configFromFile, defaults);
|
||||
this.MEMPOOL = configs.MEMPOOL;
|
||||
this.ESPLORA = configs.ESPLORA;
|
||||
this.ELECTRUM = configs.ELECTRUM;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue