Skip to content

Commit

Permalink
docs(socket.io): Update instructions in README
Browse files Browse the repository at this point in the history
  • Loading branch information
machour committed May 29, 2024
1 parent ae70493 commit 83b27f2
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions socket.io/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Socket.io is the simples way to work with WebSockets in Node.js

This example shows how to setup socket.io inside a Express server and together with a Remix app and how to connect from the browser.

To run this example, run `npm run start:dev` to start the server and `npm run dev` to watch for changes in the app.
To run this example, run `npm run dev`.

> Note: The code here needs the Express adapter and because of that it needs Node.js. This is only deployable to platforms supporting a persistent running process (unlike Serverless platforms).
Expand All @@ -16,15 +16,15 @@ Open this example on [CodeSandbox](https://codesandbox.com):

## Example

This examples uses the Express adapter to setup the HTTP server.
This example uses the Express adapter to setup the HTTP server.

Then it attaches socket.io to it and listens for a few basic events.

Client-side, it imports `io` from `socket.io-client` and uses it to connect to the WebSocket server on the root component.

It stores the socket instance in a React context and make it available for the whole app.

In the `routes/index` file it accesses the socket instance to listen for more events and renders a button which sends a message to the server on each click.
In the `routes/_index` file, it accesses the socket instance to listen for more events and renders a button which sends a message to the server on each click.

## Related Links

Expand Down

0 comments on commit 83b27f2

Please sign in to comment.