-
-
Notifications
You must be signed in to change notification settings - Fork 244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(vite-plugin-nitro): enable websocket support & add docs #1419
base: beta
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for analog-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-ng-app ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for analog-blog ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
|
||
## Enable WebSockets | ||
|
||
Currently, WebSocket support in [Nitro](https://nitro.unjs.io/guide/websocket) is experimental and it should be enabled: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, WebSocket support in [Nitro](https://nitro.unjs.io/guide/websocket) is experimental and it should be enabled: | |
Currently, WebSocket support in [Nitro](https://nitro.unjs.io/guide/websocket) is experimental and it can be enabled in the `analog` plugin: |
|
||
### WebSocket Routes | ||
|
||
Due to technical limitations in the Analog-Nitro integration, WebSocket routes are exposed without the `/api` prefix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Due to technical limitations in the Analog-Nitro integration, WebSocket routes are exposed without the `/api` prefix. | |
Analog's internal API middleware is not applied to WebSocket routes, therefore, WebSocket routes are exposed without the `/api` prefix. |
|
||
Due to technical limitations in the Analog-Nitro integration, WebSocket routes are exposed without the `/api` prefix. | ||
|
||
For example, `src/server/routes/ws/chat.ts` will be exposed as `ws://example.com/ws/chat` instead of `ws://example.com/api/ws/chat` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For example, `src/server/routes/ws/chat.ts` will be exposed as `ws://example.com/ws/chat` instead of `ws://example.com/api/ws/chat` | |
For example, `src/server/routes/ws/chat.ts` is exposed as `ws://example.com/ws/chat` instead of `ws://example.com/api/ws/chat` |
|
||
Analog also supports `WebSockets` and `Server-Sent Events` through Nitro. | ||
|
||
## Enable WebSockets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
## Enable WebSockets | |
## Enabling WebSockets |
PR Checklist
Closes #1398
What is the new behavior?
Does this PR introduce a breaking change?
Other information
[optional] What gif best describes this PR or how it makes you feel?