backend: change the default backend plugin mount point to /api
This commit is contained in:
@@ -34,7 +34,7 @@ Follow this link, [Create new OAuth App](https://github.com/settings/application
|
||||
1. Set Application Name to `backstage-dev` or something along those lines.
|
||||
1. You can set the Homepage URL to whatever you want to.
|
||||
1. The Authorization Callback URL should match the redirect URI set in Backstage.
|
||||
1. Set this to `http://localhost:7000/auth/github` for local development.
|
||||
1. Set this to `http://localhost:7000/api/auth/github` for local development.
|
||||
1. Set this to `http://{APP_FQDN}:{APP_BACKEND_PORT}/auth/github` for non-local deployments.
|
||||
|
||||
```bash
|
||||
@@ -78,14 +78,14 @@ export AUTH_AUTH0_CLIENT_SECRET=x
|
||||
|
||||
#### Creating an Azure AD App Registration
|
||||
|
||||
An Azure AD App Registration is required to be able to sign in using Azure AD and the Microsoft Graph API.
|
||||
An Azure AD App Registration is required to be able to sign in using Azure AD and the Microsoft Graph API.
|
||||
Click [here](https://portal.azure.com/#blade/Microsoft_AAD_IAM/ActiveDirectoryMenuBlade/RegisteredApps) to create a new one.
|
||||
|
||||
- Click on the `New Registration` button.
|
||||
- Give the app a name. e.g. `backstage-dev`
|
||||
- Select `Accounts in this organizational directory only` under supported account types.
|
||||
- Enter the callback URL for your backstage backend instance:
|
||||
- For local development, this is likely `http://localhost:7000/auth/microsoft/handler/frame`
|
||||
- For local development, this is likely `http://localhost:7000/api/auth/microsoft/handler/frame`
|
||||
- For non-local deployments, this will be `https://{APP_FQDN}:{APP_BACKEND_PORT}/auth/microsoft/handler/frame`
|
||||
- Click `Register`.
|
||||
|
||||
|
||||
@@ -18,4 +18,4 @@ fi
|
||||
|
||||
echo "Downloading and starting SAML-IdP"
|
||||
export NPM_CONFIG_REGISTRY=https://registry.npmjs.org
|
||||
exec npx saml-idp --acsUrl "http://localhost:7000/auth/saml/handler/frame" --audience "http://localhost:7000" --port 7001
|
||||
exec npx saml-idp --acsUrl "http://localhost:7000/api/auth/saml/handler/frame" --audience "http://localhost:7000" --port 7001
|
||||
|
||||
@@ -28,6 +28,7 @@ export interface RouterOptions {
|
||||
logger: Logger;
|
||||
database: Knex;
|
||||
config: Config;
|
||||
basePath?: string;
|
||||
}
|
||||
|
||||
export async function createRouter(
|
||||
@@ -38,7 +39,8 @@ export async function createRouter(
|
||||
|
||||
const appUrl = options.config.getString('app.baseUrl');
|
||||
const backendUrl = options.config.getString('backend.baseUrl');
|
||||
const authUrl = `${backendUrl}/auth`;
|
||||
// TODO(Rugvip): Replace with service discovery of external URL
|
||||
const authUrl = backendUrl + (options.basePath ?? '/api/auth');
|
||||
|
||||
const keyDurationSeconds = 3600;
|
||||
|
||||
|
||||
@@ -18,11 +18,11 @@ yarn start
|
||||
|
||||
## What techdocs-backend does
|
||||
|
||||
This plugin is the backend part of the techdocs plugin. It provides building and serving of your docs without having to use another service and hosting provider. To use it set your techdocs storageUrl in your `app-config.yml` to `http://localhost:7000/techdocs/static/docs`.
|
||||
This plugin is the backend part of the techdocs plugin. It provides building and serving of your docs without having to use another service and hosting provider. To use it set your techdocs storageUrl in your `app-config.yml` to `http://localhost:7000/api/techdocs/static/docs`.
|
||||
|
||||
```yaml
|
||||
techdocs:
|
||||
storageUrl: http://localhost:7000/techdocs/static/docs
|
||||
storageUrl: http://localhost:7000/api/techdocs/static/docs
|
||||
```
|
||||
|
||||
## Extending techdocs-backend
|
||||
|
||||
@@ -64,7 +64,7 @@ export class LocalPublish implements PublisherBase {
|
||||
}
|
||||
|
||||
resolve({
|
||||
remoteUrl: `http://localhost:7000/techdocs/static/docs/${entity.metadata.name}`,
|
||||
remoteUrl: `http://localhost:7000/api/techdocs/static/docs/${entity.metadata.name}`,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user