changesets: added changesets for the new root http router service

Co-authored-by: blam <ben@blam.sh>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-12-29 15:53:23 +01:00
parent 3cf5074903
commit 02b119ff93
4 changed files with 20 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'@backstage/backend-app-api': minor
---
**BREAKING**: The `httpRouterFactory` now accepts a `pathPrefix` option rather than `indexPlugin`. To set up custom index path, configure the new `rootHttpRouterFactory` with a custom `indexPath` instead.
Added an implementation for the new `rootHttpRouterServiceRef`.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-plugin-api': patch
---
Added a new `rootHttpRouterServiceRef` and `RootHttpRouterService` interface.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-defaults': patch
---
The new root HTTP router service is now installed by default.
@@ -63,6 +63,9 @@ export const rootHttpRouterFactory = createServiceFactory({
return {
use: (path: string, handler: Handler) => {
if (path.match(/^[/\s]*$/)) {
throw new Error(`Root router path may not be empty`);
}
const conflictingPath = findConflictingPath(existingPaths, path);
if (conflictingPath) {
throw new Error(