add @config annotation to docs

Signed-off-by: Juan Pablo Garcia Ripa <juanpablog@spotify.com>
This commit is contained in:
Juan Pablo Garcia Ripa
2022-11-22 23:26:23 +01:00
parent db00b1a91d
commit fcf5d4f4ba
3 changed files with 45 additions and 4 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ import express from 'express';
import { Logger } from 'winston';
import { PluginEndpointDiscovery } from '@backstage/backend-common';
// @public (undocumented)
// @public
export function createRouter(options: RouterOptions): Promise<express.Router>;
// @public (undocumented)
+18 -1
View File
@@ -178,7 +178,24 @@ export function buildMiddleware(
return createProxyMiddleware(filter, fullConfig);
}
/** @public */
/**
* Creates a new {@link https://expressjs.com/en/api.html#router | "express router"} that proxy each target configured under the `proxy` key of the config
* @example
* ```ts
* let router = await createRouter({logger, config, discovery});
* ```
* @config
* ```yaml
* proxy:
* simple-example: http://simple.example.com:8080 # Opt 1 Simple URL String
* '/larger-example/v1': # Opt 2 `http-proxy-middleware` compatible object
* target: http://larger.example.com:8080/svc.v1
* headers:
* Authorization: Bearer ${EXAMPLE_AUTH_TOKEN}
*```
* @see https://backstage.io/docs/plugins/proxying
* @public
*/
export async function createRouter(
options: RouterOptions,
): Promise<express.Router> {