https://github.com/peterdee/node-ws-als
Testing AsyncLocalStorage with Socket.IO
https://github.com/peterdee/node-ws-als
asynclocalstorage nodejs socket-io
Last synced: about 1 month ago
JSON representation
Testing AsyncLocalStorage with Socket.IO
- Host: GitHub
- URL: https://github.com/peterdee/node-ws-als
- Owner: peterdee
- License: mit
- Created: 2021-08-06T10:50:47.000Z (almost 5 years ago)
- Default Branch: stage
- Last Pushed: 2021-08-06T10:58:46.000Z (almost 5 years ago)
- Last Synced: 2025-03-14T16:49:12.162Z (over 1 year ago)
- Topics: asynclocalstorage, nodejs, socket-io
- Language: JavaScript
- Homepage: http://localhost:2112
- Size: 66.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
## node-ws-als
Testing [AsyncLocalStorage](https://nodejs.org/api/async_context.html#async_context_class_asynclocalstorage) with [Socket.IO](https://socket.io)
[Store](./store.js) is initialized in the [middleware](./middleware.js), and then accessed in [router](./router.js).
Accessing the [store](./store.js) directly in [handler](./handler.js) is not possible, data should be passed as an argument.
### Deploy
```shell script
git clone https://github.com/peterdee/node-ws-als
cd ./node-ws-als
nvm use 16
npm i
```
### Launch
```shell script
npm start
```
Backend will be running on http://localhost:1221
Frontend will be runnung on http://localhost:2112
### License
[MIT](./LICENSE.md)