Skip to content

Instantly share code, notes, and snippets.

@imjakechapman
Last active November 6, 2019 05:14
Show Gist options
  • Save imjakechapman/20615b1bc79c06607241a202ac500694 to your computer and use it in GitHub Desktop.
Save imjakechapman/20615b1bc79c06607241a202ac500694 to your computer and use it in GitHub Desktop.
import { ApolloServer } from "apollo-server";
import * as dotenv from "dotenv";
// Process env
dotenv.config();
// Apollo-Server Schema
import { schema } from "./schema";
// GraphQL Server
const server: ApolloServer = new ApolloServer(schema);
// Kick off server
server.listen(process.env.port || 8080).then(({ url }: any) => {
console.log(`🚀 Server ready at ${url}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment