2017-09-07 16 views
0

IP 주소를 통해 로컬 개발 환경에 연결하려고합니다.Apollo GraphQL : HTTPBatchedNetworkInterface의 포트 설정?

const localHostString = '10.0.1.10'; 
const METEOR_PORT = 3000; 
const GRAPHQL_PORT = 4000; 
const server = express(); 

server.use('*', cors({ origin: `http://${localHostString}:${METEOR_PORT}` })); 


server.use('/graphql', bodyParser.json(), graphqlExpress({ 
    schema, 
    context 
})); 

server.use('/graphiql', graphiqlExpress({ 
    endpointURL: '/graphql', 
    subscriptionsEndpoint: `ws://${localHostString}:${GRAPHQL_PORT}/subscriptions` 
})); 

// Wrap the Express server 
const ws = createServer(server); 
ws.listen(GRAPHQL_PORT,() => { 
    console.log(`GraphQL Server is now running on http://${localHostString}:${GRAPHQL_PORT}`); 
    console.log(`GraphiQL available at http://${localHostString}:${GRAPHQL_PORT}/graphiql`); 
    // Set up the WebSocket for handling GraphQL subscriptions 
    new SubscriptionServer({ 
     execute, 
     subscribe, 
     schema 
    }, { 
     server: ws, 
     path: '/subscriptions', 
    }); 
}); 
: 여기

"http://10.0.1.10:3000/graphql"

내 서버 측 설정 코드입니다 :

_uri: "http://10.0.1.10/graphql"

가해야 할 때 ... : HTTPBatchedNetworkInterface 보여줍니다 때문에 오류를 받고 있어요

HTTPBatchedNetworkInterface._uri에 포트 번호를 가져 오는 올바른 방법은 무엇입니까?

모든 정보에 대해 미리 감사드립니다.

답변

0

수정 됨. 내 프레임 워크는 Meteor이고 나는 ROOT_URL = 10.0.1.10:3000/을 설정해야했습니다.