New Backend Plugin Template Fixes

Signed-off-by: Andre Wanlin <awanlin@spotify.com>
This commit is contained in:
Andre Wanlin
2024-03-23 21:20:22 +01:00
parent 629612dd11
commit 91192f4e51
4 changed files with 13 additions and 4 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Updated backend plugin template to work better with new backend system
+3 -3
View File
@@ -41,16 +41,16 @@ standalone mode. You can do a first-light test of your service:
```sh
cd plugins/carmen-backend
LEGACY_BACKEND_START=true yarn start
yarn start
```
> Note: `LEGACY_BACKEND_START=true` is needed while we transition fully to the [New Backend System](../backend-system/index.md). The templates have not been migrated yet; you can track this in [issue 21288](https://github.com/backstage/backstage/issues/21288)
> Note: this documentation assumes you are using the latest version of Backstage and the new backend system. If you are not please upgrade and migrate your backend using the [Migration Guide](../backend-system/building-backends/08-migrating.md)
This will think for a bit, and then say `Listening on :7007`. In a different
terminal window, now run
```sh
curl localhost:7007/carmen/health
curl localhost:7007/api/carmen/health
```
This should return `{"status":"ok"}`. Success! Press `Ctrl + c` to stop it
@@ -7,7 +7,7 @@ _This plugin was created through the Backstage CLI_
## Getting started
Your plugin has been added to the example app in this repository, meaning you'll be able to access it by running `yarn
start` in the root directory, and then navigating to [/{{id}}](http://localhost:3000/{{id}}).
start` in the root directory, and then navigating to [/{{pluginVar}}/health](http://localhost:7007/api/{{pluginVar}}/health).
You can also serve the plugin in isolation by running `yarn start` in the plugin directory.
This method of serving the plugin provides quicker iteration speed and a faster startup and hot reloads.
@@ -26,6 +26,10 @@ export const {{pluginVar}} = createBackendPlugin({
logger,
}),
);
httpRouter.addAuthPolicy({
path: '/health',
allow: 'unauthenticated',
});
},
});
},