0
我在使用Mailjet構建應用程序,並使用它們的連接示例。使用Mailjet引發混淆錯誤的Nodejs應用程序
app.get('/send',function(req,res){
...
var request = mailjet
.post("send")
.request({
<request stuff, email details>
});
request
.on('success', function (response, body) {
<handle response>
})
.on('error', function (err, response) {
<handle error>
});
收到此錯誤:
Unhandled rejection Error: Unsuccessful
at /home/ubuntu/workspace/node_modules/node-mailjet/mailjet-client.js:203:23
當我去Mailjet客戶端,並要求它記錄錯誤,它告訴我:
{ [Error: Unauthorized]
original: null,
...
任何人都有的,其中一個想法我應該開始排除故障?
更新:在錯誤輸出看到這個:
header:
{ server: 'nginx',
date: 'Thu, 02 Mar 2017 14:04:11 GMT',
'content-type': 'text/html',
'content-length': '20',
connection: 'close',
'www-authenticate': 'Basic realm="Provide an apiKey and secretKey"',
vary: 'Accept-Encoding',
'content-encoding': 'gzip' },
,所以它不是吃我的API密鑰和密碼。任何人都可以告訴我如何將這些設置爲Cloud9中的環境變量?