add stripe and promises
This commit is contained in:
parent
41ca197500
commit
a379a3c201
|
@ -155,6 +155,8 @@ module.exports.create = function (xconfx, apiFactories, apiDeps) {
|
|||
|
||||
console.log('DEBUG pkgPath', pkgPath);
|
||||
myApp = express();
|
||||
myApp.handlePromise = require('./lib/common').promisableRequest;
|
||||
myApp.handleRejection = require('./lib/common').rejectableRequest;
|
||||
|
||||
var _getOauth3Controllers = pkgDeps.getOauth3Controllers = require('oauthcommon/example-oauthmodels').create(
|
||||
{ sqlite3Sock: xconfx.sqlite3Sock, ipcKey: xconfx.ipcKey }
|
||||
|
@ -222,6 +224,9 @@ module.exports.create = function (xconfx, apiFactories, apiDeps) {
|
|||
}
|
||||
});
|
||||
|
||||
req.Stripe = require('stripe')(siteConfig['stripe.com'].live.secret);
|
||||
req.StripeTest = require('stripe')(siteConfig['stripe.com'].test.secret);
|
||||
|
||||
req._walnutOriginalUrl = req.url;
|
||||
// "/path/api/com.example/hello".replace(/.*\/api\//, '').replace(/([^\/]*\/+)/, '/') => '/hello'
|
||||
req.url = req.url.replace(/\/api\//, '').replace(/.*\/api\//, '').replace(/([^\/]*\/+)/, '/');
|
||||
|
|
Loading…
Reference in New Issue