Skip to content

Commit

Permalink
Connect Frontend to backend using Web Socket
Browse files Browse the repository at this point in the history
  • Loading branch information
VinitGurjar committed Mar 10, 2023
1 parent 9f282a9 commit ea5e30a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ socket.onmessage = ({ data }) => {
document.querySelector("baton").onClick = () => {
socket.dispatchEvent("namaste");
};

//front end javascript app
1 change: 1 addition & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ server.on("connection", (socket) => {
socket.send(`!!captain ${message} `);
});
});
//nodejs backend

0 comments on commit ea5e30a

Please sign in to comment.