Class: BasePushRoute
Defined in: service-core/src/routes/BasePushRoute.ts:35
The BasePushRoute class provides a base set of endpoints for implement client push notifications.
Exposed endpoints:
| Name | HTTP Method | What it does |
|---|---|---|
connect | UPGRADE /<base_path>/connect | Establishes a connection to the push notification system. |
send | POST /<base_path>/:id | Sends a push notification message to the channel with the given id |
!!Note!! that the BasePushRoute is not automatically registered with a server by default. You must create
your own class that extends AdminRoute and apply the desired base path with @Route().
Example
import { BasePushRoute, RouteDecorators } from "@rapidrest/service-core";
const { Route } = RouteDecorators;
@Route("/push")
export class PushRoute extends BasePushRoute {}
Constructors
Constructor
new BasePushRoute():
BasePushRoute
Returns
BasePushRoute
Methods
connect()
connect(
sock,user):Promise<void>
Defined in: service-core/src/routes/BasePushRoute.ts:75
Parameters
sock
WebSocket
user
any
Returns
Promise<void>
send()
send(
id,msg,user):Promise<void>
Defined in: service-core/src/routes/BasePushRoute.ts:181
Parameters
id
string
msg
any
user
any
Returns
Promise<void>