Created
December 14, 2020 04:17
-
-
Save eduardopc/8538e34183ebbb5fc7a9bd82e6006106 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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