Files
backstage/plugins/app-backend
blam fff010b0d1 Merge branch 'master' of github.com:spotify/backstage into mob/union-types
* 'master' of github.com:spotify/backstage:
  Update quickstart-app-auth.md
  Update changelog
  v0.1.1-alpha.22
  v0.1.1-alpha.21
  TechDocs: Use a flag to determine if we should use a local mkdocs or techdocs-container (#2503)
  feat(catalog-backend): delete log entries older than a cutoff
  fix(workflows): do not run e2e when contrib or docs change
  chore(contrib): form the basic contrib hierarchy
  fix(catalog-backend): address comments and add docs
  fix(catalog-backend): unify github and github/api, and use git-url-parse
2020-09-20 21:00:45 +02:00
..
2020-09-18 02:44:23 +02:00
2020-08-27 07:22:14 +02:00
2020-09-18 15:14:38 +02:00
2020-08-27 07:28:27 +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

yarn add @backstage/plugin-app-backend example-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.