Skip to content

Instantly share code, notes, and snippets.

@eduardopc
Created December 14, 2020 04:17
Show Gist options
  • Save eduardopc/8538e34183ebbb5fc7a9bd82e6006106 to your computer and use it in GitHub Desktop.
Save eduardopc/8538e34183ebbb5fc7a9bd82e6006106 to your computer and use it in GitHub Desktop.
import "dotenv/config";
import { GraphQLServer } from "graphql-yoga";
import DatabaseBootstrap from './database';
import schema from './schema';
async function bootstrap() {
const server = new GraphQLServer({
schema: await schema,
});
return server;
}
bootstrap().then((server) =>
server.start(() => {
new DatabaseBootstrap().bootstrap();
console.log("Server is running on http://localhost:4000");
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment