Skip to content

mhnavid/node-react-websocket

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Real-time message exchange/passing through API call in Node and React using Websocket

Description

  • Implementation of websocket in backend and frontend
  • Serve backend and websocket together with the same application using Node (Express.js)
  • Send message during API call to the websocket
  • Receive message in React frontend client

Ports used

  • backend - 7000
  • websocket - 8000
  • frontend - 3000

TO RUN

First, enter to the backend directory and then

npm install and npm start

Second, enter to the frontend directory and then

npm install and npm start

Finally, make the POST request to send the message

curl --location --request POST 'localhost:7000/send-msg' \ --header 'Content-Type: application/json' \ --data-raw '{ "message": "test" }'

About

Node React websocket implementation & message passing through API call

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published