Merge pull request #219 from bitpay/fix/emailstoreConfig
Fixes express configuration
This commit is contained in:
commit
18405a3a92
@ -51,6 +51,13 @@ module.exports = function(app) {
|
|||||||
var currency = require('../app/controllers/currency');
|
var currency = require('../app/controllers/currency');
|
||||||
app.get(apiPrefix + '/currency', currency.index);
|
app.get(apiPrefix + '/currency', currency.index);
|
||||||
|
|
||||||
|
// Email store plugin
|
||||||
|
var emailPlugin = require('../plugins/emailstore');
|
||||||
|
app.post(apiPrefix + '/email/register', emailPlugin.post);
|
||||||
|
app.post(apiPrefix + '/email/validate', emailPlugin.validate);
|
||||||
|
app.get(apiPrefix + '/email/retrieve/:email', emailPlugin.get);
|
||||||
|
app.get(apiPrefix + '/email/validate', emailPlugin.validate);
|
||||||
|
|
||||||
//Home route
|
//Home route
|
||||||
var index = require('../app/controllers/index');
|
var index = require('../app/controllers/index');
|
||||||
app.get(apiPrefix + '/version', index.version);
|
app.get(apiPrefix + '/version', index.version);
|
||||||
|
|||||||
10
insight.js
10
insight.js
@ -143,16 +143,8 @@ if (config.enableMonitor) {
|
|||||||
require('./plugins/monitor').init(config.monitor);
|
require('./plugins/monitor').init(config.monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.enableCredentialstore) {
|
|
||||||
require('./plugins/credentialstore').init(expressApp, config.credentialstore);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.enableEmailstore) {
|
if (config.enableEmailstore) {
|
||||||
require('./plugins/emailstore').init(expressApp, config.emailstore);
|
require('./plugins/emailstore').init(config.emailstore);
|
||||||
}
|
|
||||||
|
|
||||||
if (config.enablePublicInfo) {
|
|
||||||
require('./plugins/publicInfo/publicInfo').init(expressApp, config.emailstore);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// express settings
|
// express settings
|
||||||
|
|||||||
@ -95,10 +95,9 @@ var makeKey = function(email, key) {
|
|||||||
/**
|
/**
|
||||||
* Initializes the plugin
|
* Initializes the plugin
|
||||||
*
|
*
|
||||||
* @param {Express} expressApp
|
|
||||||
* @param {Object} config
|
* @param {Object} config
|
||||||
*/
|
*/
|
||||||
emailPlugin.init = function (expressApp, config) {
|
emailPlugin.init = function (config) {
|
||||||
logger.info('Using emailstore plugin');
|
logger.info('Using emailstore plugin');
|
||||||
|
|
||||||
var path = globalConfig.leveldb + '/emailstore' + (globalConfig.name ? ('-' + globalConfig.name) : '');
|
var path = globalConfig.leveldb + '/emailstore' + (globalConfig.name ? ('-' + globalConfig.name) : '');
|
||||||
@ -113,11 +112,6 @@ emailPlugin.init = function (expressApp, config) {
|
|||||||
+ globalConfig.apiPrefix
|
+ globalConfig.apiPrefix
|
||||||
+ '/email/validate'
|
+ '/email/validate'
|
||||||
);
|
);
|
||||||
|
|
||||||
expressApp.post(globalConfig.apiPrefix + '/email/register', emailPlugin.post);
|
|
||||||
expressApp.get(globalConfig.apiPrefix + '/email/retrieve/:email', emailPlugin.get);
|
|
||||||
expressApp.post(globalConfig.apiPrefix + '/email/validate', emailPlugin.validate);
|
|
||||||
expressApp.get(globalConfig.apiPrefix + '/email/validate', emailPlugin.validate);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user