Last active
November 25, 2020 14:47
-
-
Save ghaffaru/7a159c8f8ce9fd55d28a9329786eb677 to your computer and use it in GitHub Desktop.
Revisions
-
ghaffaru revised this gist
Nov 25, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -27,7 +27,9 @@ socket.emit("user-at-jobSite", { memberId: "5fabe8d677dff916ba7bde5f", jobSiteId: "5fad3bb214921641993da3dc", latitude: 5.668124, longitude: -0.177345 }) }) } -
ghaffaru created this gist
Nov 17, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Socket Test</title> <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.3.1/socket.io.js"></script> </head> <body> <div id="app"> </div> <script> const socket = io("http://localhost:4000", {transports: ['websocket'], upgrade: false}); let vue = new Vue({ el: "#app", mounted() { socket.on('connect', () => { socket.emit("user-at-jobSite", { memberId: "5fabe8d677dff916ba7bde5f", jobSiteId: "5fad3bb214921641993da3dc" }) }) } }) </script> </body> </html>