$ npm install -g nodemon
$ cd app
$ npx create-react-app client
$ cd app
$ mkdir posts
$ cd posts
$ npm init -y
$ npm install --save express cors axios
$ cd app
$ mkdir comments
$ cd comments
$ npm init -y
$ npm install --save express cors axios
$ cd posts
$ npm run start
$ curl \
--request POST http://localhost:4000/posts/ \
--header "Content-Type: application/json" \
| python -m json.tool
$ curl \
--request GET http://localhost:4000/posts/ \
--header "Content-Type: application/json" \
| python -m json.tool
$ echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
to solve issue:
[nodemon] Internal watch failed: ENOSPC: System limit for number of file watchers reached, watch ***
$ cd comments
$ npm run start
$ curl \
--data '{"content":"I am a comment"}' \
--header "Content-Type: application/json" \
--request POST http://localhost:4001/posts/123/comments \
| python -m json.tool
$ curl \
--request GET http://localhost:4001/posts/123/comments \
--header "Content-Type: application/json" \
| python -m json.tool
$ cd client
$ npm install --save axios
$ npm start
$ cd app
$ mkdir event-bus
$ cd event-bus
$ npm init -y
$ npm install --save express axios
$ npm run start
$ cd app
$ mkdir query
$ cd query
$ npm init -y
$ npm install --save express cors axios
$ npm run start
$ cd app
$ mkdir moderation
$ cd moderation
$ npm init -y
$ npm install --save express axios
$ npm run start
Comment with text 'orange' has status 'rejected'.