Skip to main content

HttpRouterService

Home > @backstage/backend-plugin-api > HttpRouterService

Allows plugins to register HTTP routes.

See the service documentation for more details.

Signature:

export interface HttpRouterService 

Methods

Method

Description

addAuthPolicy(policy)

Adds an auth policy to the router. This is used to allow unauthenticated or cookie based access to parts of a plugin's API.

use(handler)

Registers an Express request handler under the plugin's base router. This typically makes its base path /api/<plugin-id>.