From 08ef7995c44ba1dec08f4aafaa8c4ab6d4b77349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20Adel=C3=B6w?= Date: Tue, 24 Jan 2023 15:51:53 +0100 Subject: [PATCH] review comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Fredrik Adelöw --- .../building-plugins-and-modules/01-index.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/docs/backend-system/building-plugins-and-modules/01-index.md b/docs/backend-system/building-plugins-and-modules/01-index.md index b8eb1ed2a2..05908e59cb 100644 --- a/docs/backend-system/building-plugins-and-modules/01-index.md +++ b/docs/backend-system/building-plugins-and-modules/01-index.md @@ -42,9 +42,9 @@ export const examplePlugin = createBackendPlugin({ httpRouter, }) { // Perform your initialization and access the services as needed - const router = createExampleRouter(logger); + const example = createExampleRouter(logger); logger.info('Hello from example plugin'); - httpRouter.use(example.router()); + httpRouter.use(example); }, }); }, @@ -137,12 +137,13 @@ the full path would then be The same applies for modules that perform their own migrations and interact with the database. They will run on the same logical database instance as the target plugin, so care must be taken to choose table names that do not risk colliding -with those of the plugin. A recommended naming pattern is `__`, for example the `@backstage/backend-tasks` package creates tables named -`backstage_backend_tasks__
`. If you use the default Knex migration -facilities, you will also want to make sure that it uses a similarly prefixed -lock file for its internal bookkeeping needs, so it does not collide with the -main lock files used by the plugin itself. You can do this as follows: +with those of the plugin. A recommended naming pattern is `__
`, for example the `@backstage/backend-tasks` package creates +tables named `backstage_backend_tasks__
`. If you use the default [`Knex` +migration facilities](https://knexjs.org/guide/migrations.html), you will also +want to make sure that it uses similarly prefixed migration state tables for its +internal bookkeeping needs, so they do not collide with the main ones used by +the plugin itself. You can do this as follows: ```ts await knex.migrate.latest({