Skip to content

Instantly share code, notes, and snippets.

@velotiotech
Created December 7, 2020 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save velotiotech/acc419e97b302b71dc33ba34bf3a6b88 to your computer and use it in GitHub Desktop.
Save velotiotech/acc419e97b302b71dc33ba34bf3a6b88 to your computer and use it in GitHub Desktop.
import { ApolloServer } from 'apollo-server';
import { ApolloGateway } from '@apollo/gateway';
const gateway = new ApolloGateway({
serviceList: [
{ name: 'users', url: 'http://localhost:4001' },
{ name: 'tweets', url: 'http://localhost:4002' },
],
});
const server = new ApolloServer({ gateway, subscriptions: false });
server.listen().then(({ url }) => {
console.log(`Server ready at url: ${url}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment