-
Install it as a dev dependency:
npm install --save-dev nodemon
-
Add command for running nodemon in your package.json file:
"dev": "nodemon --watch index.js --watch lib --watch config.js index.js"
- Usage:
npm run dev
- This will enable us to make changes to the server without having to restart it as it will be done automatically
By making use of the documentation: HTTP AJAX (15 min)
- Add an
HTTP GET
method inindex.js
to retrieve a mocked JSON with information about your application - Use the newly created http method in
About.js
- Method should update your data variable to contain the result of the request
- Use
Debug
tools from your browser and check network calls to see if data is received correctly
- Make use of RemoteData to display information to the user when the requested data is in different states:
- NotAsked
- Loading
- Failure
- Successful
- Add a websocket on the server side,
index.js
, and bind it to the server - Use it to send every 5 seconds a random number as a message under a certain command
- Make use of
WebSocketClient.js
and add it to yourModel.js
; - Add a new component in the header of
view.js
with the random number received via websocket - Use DebugTools to watch all numbers sent via webSockets