Files
backstage/plugins/app-backend
Patrik Oldsberg 820de63018 Merge pull request #6076 from backstage/rugvip/allreports
scripts/api-extractor: create and check API reports for all(most) plugins
2021-06-17 15:46:11 +02:00
..
2021-06-17 13:30:06 +02:00
2021-06-17 08:08:44 +00:00
2021-06-17 08:08:44 +00:00
2021-05-02 22:13:05 +02:00

App backend plugin

This backend plugin can be installed to serve static content of a Backstage app.

Installation

Add both this package and your local frontend app package as dependencies to your backend, for example

# From your Backstage root directory
cd packages/backend
yarn add @backstage/plugin-app-backend app

By adding the app package as a dependency we ensure that it is built as part of the backend, and that it can be resolved at runtime.

Now add the plugin router to your app, creating it for example like this:

const router = await createRouter({
  logger,
  appPackageName: 'example-app',
});

And registering it like this:

createServiceBuilder(module)
  ...
  .addRouter('', router);

Be sure to register the app router last, as it serves content for HTML5-mode navigation, i.e. falling back to serving index.html for any route that can't be found.