You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,9 @@ Inspired by <a href="https://github.com/cloudflare/templates/tree/main/multiplay
25
25
26
26
When the first request is made, the server store the user's location (latitude and longitude) using the [`useState`](https://nuxt.com/docs/api/composables/use-state) composable in the [`app/plugins/location.server.ts`](./app/plugins/location.server.ts) file.
27
27
28
-
A `/visitors` websocket endpoint is created in the [`server/routes/visitors.ts`](./server/routes/visitors.ts) file using the [`defineWebSocketHandler`](https://nitro.build/guide/websocket) function.
28
+
A `/ws/visitors` websocket endpoint is created in the [`server/routes/ws/visitors.ts`](./server/routes/ws/visitors.ts) file using the [`defineWebSocketHandler`](https://nitro.build/guide/websocket) function.
29
29
30
-
When the [`index.vue` page](./app/pages/index.vue) is mounted on client-side, it connects to the `/visitors` websocket endpoint with its location as query parameters to the server.
30
+
When the [`index.vue` page](./app/pages/index.vue) is mounted on client-side, it connects to the `/ws/visitors` websocket endpoint with its location as query parameters to the server.
31
31
32
32
The websocket endpoints send back the user locations to the client-side.
0 commit comments