to setup this project run the following command in your terminal when you are IN your project folder.
npm install
to run the server in watch mode run:
npm run dev
and in another terminal window
npm run json:server
now the nodejs server is running AND the json db is up. Browse to: http://localhost:4000/graphql
The json db can be access by: http://localhost:3000/instances or http://localhost:3000/instances/23 or http://localhost:3000/metrics
inside the GraphiQL you can type:
{
instances(offset:0, limit:0){
id
name
}
}
and you'll get
{
"data": {
"instances": [
{
"id": "23",
"name": "Application ABC"
},
{
"id": "47",
"name": "Application DEF"
},
{
"id": "41",
"name": "Application GHI"
}
]
}
}