2
2
3
3
This is feedback-backend plugin which provides Rest API to create feedbacks.
4
4
5
- It is also repsonsible for creating JIRA tickets,
5
+ It is also responsible for creating JIRA tickets,
6
6
7
7
## Getting started
8
8
9
9
### Installation
10
10
11
- 1 . Install the backend plugin.
11
+ Install the NPM Package
12
12
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
17
19
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:
19
21
20
- ``` ts
22
+ ``` ts title="packages/backend/src/plugins/feedback.ts"
21
23
import { Router } from ' express' ;
22
24
23
25
import { createRouter } from ' @janus-idp/backstage-plugin-feedback-backend' ;
@@ -35,9 +37,9 @@ It is also repsonsible for creating JIRA tickets,
35
37
}
36
38
```
37
39
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 :
39
41
40
- ``` ts
42
+ ``` ts title="packages/backend/src/index.ts"
41
43
import feedback from ' ./plugins/feedback' ;
42
44
43
45
// ...
@@ -48,35 +50,50 @@ It is also repsonsible for creating JIRA tickets,
48
50
}
49
51
```
50
52
51
- 4 . Now add below config in your ` app-config.yaml ` file.
53
+ #### Adding the plugin to the new backend
52
54
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:
60
56
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 ();
65
59
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 ' ));
68
62
69
- # # [optional] Authorization using user and password
70
- auth :
71
- user : ${EMAIL_USER}
72
- pass : ${EMAIL_PASS}
63
+ backend .start ();
64
+ ```
73
65
74
- # boolean
75
- secure : false
66
+ ### Configurations
76
67
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
+ ` ` `
80
97
81
98
### Set up frontend plugin
82
99
@@ -86,6 +103,6 @@ Follow instructions provided [feedback-plugin](../feedback/README.md)
86
103
87
104
The API specifications file can be found at [docs/openapi3_0](./docs/openapi3_0.yaml)
88
105
89
- ### Run
106
+ ### Running the plugin
90
107
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