2017-02-01 11 views
0

기존의 휴면 엔드 포인트를 아폴로 서버에 추가하고 Meteors 인증 시스템을 재사용하고 싶습니다. 그러나 Meteor.user()은이 컨텍스트에서 정의되지 않습니다. 엔드 포인트는 사용자 신임을 보거나 요구하지 않습니다.createApolloServer 호출에서 configServer의 Meteor 인증 사용하기

https://github.com/stubailo/meteor-rest/

simple:json-routes 

당신은

simple:rest-accounts-password 
simple:authenticate-user-by-token 

인증을 수행 할 수 있습니다 당신은 전통적인 REST 엔드 포인트를 만들기 위해 유성, 최선의 방법을 사용하는 경우

createApolloServer(... , { 
    configServer: (app) => { 
    app.use('/myEndpoint',() => { 
     /* I want to have a meteor userId here */ 
    }); 
    }, 
}); 

답변