Skip to content

Instantly share code, notes, and snippets.

@erebus1
Created November 12, 2019 13:31
Show Gist options
  • Save erebus1/70d675be8002226ba969f7817ecc6340 to your computer and use it in GitHub Desktop.
Save erebus1/70d675be8002226ba969f7817ecc6340 to your computer and use it in GitHub Desktop.
import {ApolloServer} from 'apollo-server'
import {ApolloGateway} from '@apollo/gateway'
const monolith_url: string = 'http://monolith:5000/graphql';
const filemanager_url: string = 'http://filemanager:5000/graphql';
const gateway = new ApolloGateway({
serviceList: [
{ name: 'monolith', url: monolith_url },
{ name: 'filemanager', url: filemanager_url },
],
});
const server = new ApolloServer({
gateway,
subscriptions: false
});
server.listen(3000).then(({ url }) => {
console.log(`🚀 Server ready at ${url}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment