Skip to content

Commit e2e33ac

Browse files
committed
docs(feedback-backend): update README with new backend installation procedure
1 parent ffd249d commit e2e33ac

File tree

1 file changed

+52
-35
lines changed

1 file changed

+52
-35
lines changed

plugins/feedback-backend/README.md

Lines changed: 52 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,24 @@
22

33
This is feedback-backend plugin which provides Rest API to create feedbacks.
44

5-
It is also repsonsible for creating JIRA tickets,
5+
It is also responsible for creating JIRA tickets,
66

77
## Getting started
88

99
### Installation
1010

11-
1. Install the backend plugin.
11+
Install the NPM Package
1212

13-
```bash
14-
# From your backstage root directory
15-
yarn workspace backend add @janus-idp/backstage-plugin-feedback-backend
16-
```
13+
```bash
14+
# From your backstage root directory
15+
yarn workspace backend add @janus-idp/backstage-plugin-feedback-backend
16+
```
17+
18+
#### Adding the plugin to the legacy backend
1719

18-
2. Then create a new file `packages/backend/src/plugins/feedback.ts` and add the following:
20+
1. Create a new file `packages/backend/src/plugins/feedback.ts` and add the following:
1921

20-
```ts
22+
```ts title="packages/backend/src/plugins/feedback.ts"
2123
import { Router } from 'express';
2224

2325
import { createRouter } from '@janus-idp/backstage-plugin-feedback-backend';
@@ -35,9 +37,9 @@ It is also repsonsible for creating JIRA tickets,
3537
}
3638
```
3739

38-
3. Next we wire this into overall backend router, edit `packages/backend/src/index.ts`:
40+
2. Next we wire this into overall backend router by editing the `packages/backend/src/index.ts` file:
3941

40-
```ts
42+
```ts title="packages/backend/src/index.ts"
4143
import feedback from './plugins/feedback';
4244

4345
// ...
@@ -48,35 +50,50 @@ It is also repsonsible for creating JIRA tickets,
4850
}
4951
```
5052

51-
4. Now add below config in your `app-config.yaml` file.
53+
#### Adding the plugin to the new backend
5254

53-
```yaml
54-
feedback:
55-
integrations:
56-
jira:
57-
# Under this object you can define multiple jira hosts
58-
- host: ${JIRA_HOST_URL}
59-
token: ${JIRA_TOKEN}
55+
Add the following to your `packages/backend/src/index.ts` file:
6056

61-
email:
62-
## Email integration uses nodemailer to send emails
63-
host: ${EMAIL_HOST}
64-
port: ${EMAIL_PORT} # defaults to 587, if not found
57+
```ts title="packages/backend/src/index.ts"
58+
const backend = createBackend();
6559

66-
## Email address of sender
67-
from: ${EMAIL_FROM}
60+
// Add the following line
61+
backend.add(import('@janus-idp/backstage-plugin-feedback-backend/alpha'));
6862

69-
## [optional] Authorization using user and password
70-
auth:
71-
user: ${EMAIL_USER}
72-
pass: ${EMAIL_PASS}
63+
backend.start();
64+
```
7365

74-
# boolean
75-
secure: false
66+
### Configurations
7667

77-
# Path to ca certificate if required by mail server
78-
caCert: ${NODE_EXTRA_CA_CERTS}
79-
```
68+
Add the following config in your `app-config.yaml` file.
69+
70+
```yaml
71+
feedback:
72+
integrations:
73+
jira:
74+
# Under this object you can define multiple jira hosts
75+
- host: ${JIRA_HOST_URL}
76+
token: ${JIRA_TOKEN}
77+
78+
email:
79+
## Email integration uses nodemailer to send emails
80+
host: ${EMAIL_HOST}
81+
port: ${EMAIL_PORT} # defaults to 587, if not found
82+
83+
## Email address of sender
84+
from: ${EMAIL_FROM}
85+
86+
## [optional] Authorization using user and password
87+
auth:
88+
user: ${EMAIL_USER}
89+
pass: ${EMAIL_PASS}
90+
91+
# boolean
92+
secure: false
93+
94+
# Path to ca certificate if required by mail server
95+
caCert: ${NODE_EXTRA_CA_CERTS}
96+
```
8097
8198
### Set up frontend plugin
8299
@@ -86,6 +103,6 @@ Follow instructions provided [feedback-plugin](../feedback/README.md)
86103
87104
The API specifications file can be found at [docs/openapi3_0](./docs/openapi3_0.yaml)
88105
89-
### Run
106+
### Running the plugin
90107
91-
1. Now run `yarn workspace @janus-idp/backstage-plugin-feedback-backedn start-backend`.
108+
Run `yarn workspace @janus-idp/backstage-plugin-feedback-backend start`.

0 commit comments

Comments
 (0)