Move dapp-config file

This commit is contained in:
Richard Ramos 2019-11-18 14:49:16 -04:00
parent 7b5a815bfe
commit abc4993d4b
4 changed files with 4 additions and 7 deletions

View File

@ -31,7 +31,7 @@ yarn
The `ENV` variable can be used to set these variables, as well as a `.secret.json` file.
#### Dapp
Each dapp should have their own configuration and templates to send emails. To add a dapp, create a folder inside `./dapps/` with the dapp name. Also, edit `./config/dapps.js` lines 10 and 16 to add the new dapp. (**This will change with a proper dapp registry, to avoid this manual process**)
Each dapp should have their own configuration and templates to send emails. To add a dapp, create a folder inside `./dapps/` with the dapp name. Also, edit `./dapps-config.js` lines 10 and 16 to add the new dapp. (**This will change with a proper dapp registry, to avoid this manual process**)
Each dapp folder should have a `config.js` file and one or more .html and .txt templates. See `./dapps/teller-network/config.js` for a sample config.

View File

@ -8,7 +8,7 @@ const errorHandler = require("./error-handler");
const config = require("../config");
const Database = require("../database");
const Mailer = require("../mail/sendgrid");
const DappConfig = require("../config/dapps");
const DappConfig = require("../dapp-config");
const Controller = require("./controller");
const logger = require("../logger")('api');

View File

@ -21,10 +21,7 @@ class DAppConfig {
return this.configurations[dappId];
}
const templatePath = path.join("../dapps", dappId);
this.configurations[dappId] = require(path.join(
path.join("./", templatePath, "config.js")
));
this.configurations[dappId] = require('./' + path.join('./dapps/', dappId, "config.js"));
return this.configurations[dappId];
}

View File

@ -4,7 +4,7 @@ const Database = require("../database");
const Ethereum = require("./ethereum");
const { addressCompare } = require("./utils");
const Mailer = require("../mail/sendgrid");
const DappConfig = require("../config/dapps");
const DappConfig = require("../dapp-config");
const Subscribers = require("../models/subscribers");
const logger = require("../logger")('watcher');
const events = new Events();