socket.io-website
socket.io-website copied to clipboard
docs: add global middleware section to middlewares page (fixes #4609)
Description
The /docs/v4/middlewares/ page only showed middleware examples for the main namespace (/),
with no mention of how to apply middleware globally across all namespaces.
This was confusing because the existing how-to guide (/how-to/register-a-global-middleware)
already covered this topic but was not discoverable from the main middleware docs page.
Changes
- Added a new "Applying middleware to all namespaces" section at the bottom of the middlewares page
- Shows how to use the
new_namespaceevent to register global middleware - Includes a caution about namespace registration order
- Links to the existing how-to guide for additional patterns (manual registration, dynamic namespaces)
Related
Fixes socketio/socket.io#4609
@tech00exploere is attempting to deploy a commit to the SocketIO Team on Vercel.
A member of the Team first needs to authorize it.
Hi! Just following up on this PR. Please let me know if there are any changes you'd like me to make. Thanks!