簡體   English   中英

Meteor Call返回404 Method Not Found

[英]Meteor Call returning 404 Method Not Found

        Meteor.call('create_question', title, content, function(error, result) {
            console.log('create_question error ' + error);
            console.log('create_question result ' + result);

            if (error) {

            } else {
                console.log('Your question was submitted');
            }
        });

這是我在客戶端調用Meteor調用。

我在服務器上有這個。

Meteor.methods({
    create_question: function(question_title, question_content) {
// does stuff   
    },

});

但由於某種原因,我一直沒有找到方法。 誰知道什么是錯的? 我在服務器文件夾中有Meteor.methods,在客戶端文件夾中有調用。

該方法create_question應在客戶端和服務器上定義。

您可以使用this.isSimulation來確定是在服務器上還是在客戶端上執行Method(作為存根)。

可能是您的create_question方法中調用的另一個方法未定義。

這是我的問題,但錯誤消息仍然表示create_question方法是create_question方法。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM