UNPKG

venmjs

Version:

This is a tool 🔧 that can be installed in your terminal at any time ⛏️ it was made for beginners and even for experts, for his utilities, and for a simple creation process 🧨. Every web developer knows how frustrating is to deal with the creation of a ne

25 lines (19 loc) 474 B
const express = require('express'); const graphQLHttp = require('express-graphql'); const schema = require('./graphql/schema'); const cors = require('cors'); const app = express(); require('dotenv').config(); require("./helpers/db/mongodb.js")(); app.use(cors()); app.use( '/graphql', graphQLHttp({ schema, graphiql: true, }), ); const PORT = process.env.PORT || 9000; app.listen(PORT, () => { console.log(`Listening on localhost:${PORT}/graphql`); });