OpenShift
Node.js
在应用程序的早期,process.env.OPENSHIFT_REPO_DIR
环境变量是可用的。不,我迁移到了OpenShift 3
,我得到了错误。
var apn = require('apn');
var optionsP = {
token: {
key: process.env.OPENSHIFT_REPO_DIR + 'APNsAuthKey_AQ34EHZCDQ.p8',
keyId: "AQ34EHZCDQ",
teamId: "AQUJ3H44A4",
},
production: true,
};
var apnProviderP = new apn.Provider(optionsP);
/opt/app-root/src/node_modules/apn/lib/credentials/token/prepare.js:15
throw new VError(err, "Failed loading token key");
^
VError: Failed loading token key: ENOENT: no such file or directory, open 'undefinedAPNsAuthKey_AQ34EHZCDQ.p8'
at prepareToken (/opt/app-root/src/node_modules/apn/lib/credentials/token/prepare.js:15:13)
at config (/opt/app-root/src/node_modules/apn/lib/config.js:42:31)
at new Client (/opt/app-root/src/node_modules/apn/lib/client.js:11:19)
at EventEmitter.Provider (/opt/app-root/src/node_modules/apn/lib/provider.js:12:19)
at Object.<anonymous> (/opt/app-root/src/server.js:26:20)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
任何的想法?