File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ import {
61
61
HttpAuthService ,
62
62
LoggerService ,
63
63
} from ' @backstage/backend-plugin-api' ;
64
+ import { Config } from ' @backstage/config' ;
64
65
65
66
/* highlight-add-start */
66
67
import { DefaultAuditLogger } from ' @janus-idp/backstage-plugin-audit-log-node' ;
@@ -69,14 +70,15 @@ import { DefaultAuditLogger } from '@janus-idp/backstage-plugin-audit-log-node';
69
70
70
71
export interface RouterOptions {
71
72
logger: LoggerService ;
73
+ config: Config ;
72
74
auth: AuthService ;
73
75
httpAuth: HttpAuthService ;
74
76
}
75
77
76
78
export async function createRouter(
77
79
options : RouterOptions ,
78
80
): Promise <express .Router > {
79
- const { logger, auth, httpAuth } = options ;
81
+ const { logger, config, auth, httpAuth } = options ;
80
82
81
83
/* highlight-add-start */
82
84
const auditLogger = new DefaultAuditLogger ({
@@ -111,7 +113,10 @@ export async function createRouter(
111
113
});
112
114
/* highlight-add-end */
113
115
});
114
- router .use (errorHandler ());
116
+
117
+ const middleware = MiddlewareFactory .create ({ logger , config });
118
+
119
+ router .use (middleware .error ());
115
120
return router ;
116
121
}
117
122
```
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @janus-idp/backstage-plugin-audit-log-node" ,
3
3
"description" : " Node.js library for the audit-log plugin" ,
4
- "version" : " 1.4.0 " ,
4
+ "version" : " 1.4.1 " ,
5
5
"main" : " src/index.ts" ,
6
6
"types" : " src/index.ts" ,
7
7
"license" : " Apache-2.0" ,
You can’t perform that action at this time.
0 commit comments