2012-12-16 57 views

回答

3

如果在包看起來/賬戶,OAuth的幫手/ oauth_server.js你會發現如何讓服務器爲例監聽HTTP:

// Listen to incoming OAuth http requests 
__meteor_bootstrap__.app 
    .use(connect.query()) 
    .use(function(req, res, next) { 
    // Need to create a Fiber since we're using synchronous http 
    // calls and nothing else is wrapping this in a fiber 
    // automatically 
    Fiber(function() { 
     Accounts.oauth._middleware(req, res, next); 
    }).run(); 
    }); 

相反spawing光纖和調用到的OAuth中間件邏輯,您可以檢查req.url並設置HTTP標頭爲res.writeHead,並呼叫res.end(),或繼續進入通常的流星堆棧,其中next()

+0

不想在這裏創建一個參數,但是我的編輯這篇文章和修改res.next()到next()的建議仍然顯示正確,即使它被拒絕了。 –

+1

非常正確。不知道爲什麼被拒絕。我只是做了改變。 – debergalis

+0

謝謝debergalis! –