Websocket Plugin
The websocket plugin is responsible for enabling websockets on your application.
Usage
typescript
import { type App } from '@vercube/core';
import { WebsocketPlugin } from '@vercube/ws';
/**
* Setup the application.
* @param {App} app - The application instance.
*/
export async function setup(app: App): Promise<void> {
// register plugins
app.addPlugin(WebsocketPlugin);
}
// We register the WebsocketPlugin to the app exporting a setup function
// that we pass when calling "createApp"
const app = await createApp({ setup });
See Also
- Namespace Decorator - Documentation of the Namespace decorator
- OnConnectionAttempt Decorator - Documentation of the OnConnectionAttempt decorator
- Message Decorator - Documentation of the Message decorator
- Emit Decorator - Documentation of the Emit decorator
- Broadcast Decorator - Documentation of the Broadcast decorator
- BroadcastOthers Decorator - Documentation of the BroadcastOthers decorator