2012-12-16 61 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! –