feat: signals plugins
next try after #18153 without any external dependencies and only supporting websocket. missing tests and necessary documentation but will work on those after initial comments if this would be proper way to go forward. already planning for the notification plugins on top of this. Signed-off-by: Heikki Hellgren <heikki.hellgren@op.fi>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# signals
|
||||
|
||||
Welcome to the signals backend plugin!
|
||||
|
||||
Signals plugin allows backend plugins to publish messages to frontend plugins.
|
||||
|
||||
## Getting started
|
||||
|
||||
Add Signals router to your backend in `packages/backend/src/plugins/signals.ts`:
|
||||
|
||||
```ts
|
||||
import { Router } from 'express';
|
||||
import { createRouter } from '@backstage/plugin-signals-backend';
|
||||
import { SignalsService } from '@backstage/plugin-signals-node';
|
||||
import { PluginEnvironment } from '../types';
|
||||
|
||||
export default async function createPlugin(
|
||||
env: PluginEnvironment,
|
||||
): Promise<Router> {
|
||||
const service = SignalsService.create({
|
||||
logger: env.logger,
|
||||
identity: env.identity,
|
||||
eventBroker: env.eventBroker,
|
||||
});
|
||||
|
||||
return await createRouter({
|
||||
logger: env.logger,
|
||||
service,
|
||||
});
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user