// set up the npm project

npm init

 

// Add in express ,  express-graphql , graphql

Express is the server

Graphql is this library

 

// Install nodemon

nodemon is a tool that helps develop Node.js based applications by automatically restarting the node application when file changes in the directory are detected.

nodemon does not require any additional changes to your code or method of development. nodemon is a replacement wrapper for node. To use nodemon, replace the word node on the command line when executing your script.

 

 npm i --save-dev nodemon

 

STEP

// Add in the devStart script into package.js

"scripts": {
"devStart": "nodemon server.js"
},

 

STEP

// Set up a basic express server

 

// server.js

const express = require('express')
const app = express()
const port = 5000

app.get('/', (req, res) => {
  res.send('Hello World')
})

app.listen(port, () => console.log('Server Running'))