federation/gateway/index.js
2020-11-14 16:43:58 +01:00

19 lines
No EOL
481 B
JavaScript

import {ApolloServer} from "apollo-server";
import {ApolloGateway} from "@apollo/gateway";
const gateway = new ApolloGateway({
serviceList: [
{name: 'users', url: 'http://localhost:5001'},
{name: 'reviews', url: 'http://localhost:5002'},
{name: 'products', url: 'http://localhost:5003'},
]
})
const server = new ApolloServer({
gateway,
subscriptions: false
})
server.listen().then(({url}) => {
console.log(`Server ready at ${url}`)
})