2015-10-12 30 views
0

我總是得到錯誤說:配置山魈一起來看流星失敗

TypeError: Cannot call method 'config' of undefined.

這是server.js我的啓動功能。我做錯了什麼?

Meteor.startup(function() { 
 
\t return Meteor.Mandrill.config({ 
 
\t username: "SMTP Username", 
 
\t key: "Valid API Key", 
 
\t password: "Valid API Key", 
 
\t port: "587", 
 
\t host:"smtp.mandrillapp.com" 
 
\t }); 
 
});

回答

1

流星啓動功能的目的不是要返回的東西,這是你的第一個錯誤。
另一方面,我可以在their documentation上看到,您必須直接配置對象Mandrill。

if (Meteor.isServer) { 
    // server code 
    Mandrill.config({ 
      username: "SMTP Username", 
      key: "Valid API Key", 
      password: "Valid API Key", 
      port: "587", 
      host:"smtp.mandrillapp.com" 
     // baseUrl: 'https://mandrillapp.com/api/1.0/' // update this in case Mandrill changes its API endpoint URL or version 
    }); 

    // you can put a Meteor startup here if you want : 
    Meteor.startup(function() { 
     // Do somthing else, like populating, ... 
    }); 
}