Skip to main content
Version: Next

RouterOptions

Home > @backstage/plugin-app-backend > RouterOptions

Warning: This API is now obsolete.

Please migrate to the new backend system as this will be removed in the future.

Signature:

export interface RouterOptions 

Properties

Property

Modifiers

Type

Description

appPackageName

string

The name of the app package that content should be served from. The same app package should be added as a dependency to the backend package in order for it to be accessible at runtime.

In a typical setup with a single app package this would be set to 'app'.

auth?

AuthService

(Optional)

config

RootConfigService

database?

DatabaseService

(Optional) If a database is provided it will be used to cache previously deployed static assets.

This is a built-in alternative to using a staticFallbackHandler.

disableConfigInjection?

boolean

(Optional) Disables the configuration injection. This can be useful if you're running in an environment with a read-only filesystem, or for some other reason don't want configuration to be injected.

Note that this will cause the configuration used when building the app bundle to be used, unless a separate configuration loading strategy is set up.

This also disables configuration injection though APP_CONFIG_ environment variables.

httpAuth?

HttpAuthService

(Optional)

logger

LoggerService

schema?

ConfigSchema

(Optional) Provides a ConfigSchema.

staticFallbackHandler?

express.Handler

(Optional) A request handler to handle requests for static content that are not present in the app bundle.

This can be used to avoid issues with clients on older deployment versions trying to access lazy loaded content that is no longer present. Typically the requests would fall back to a long-term object store where all recently deployed versions of the app are present.

Another option is to provide a database that will take care of storing the static assets instead.

If both database and staticFallbackHandler are provided, the database will attempt to serve static assets first, and if they are not found, the staticFallbackHandler will be called.