chore(app): use backend.baseUrl

This commit is contained in:
Fredrik Adelöw
2020-06-30 10:35:31 +02:00
parent 1b2e60ada4
commit 3fc01de554
3 changed files with 8 additions and 12 deletions
-7
View File
@@ -76,13 +76,6 @@
"pathRewrite": {
"^/circleci/api/": "/"
}
},
"/catalog/api": {
"target": "http://localhost:7000",
"changeOrigin": true,
"pathRewrite": {
"^/catalog/api/": "/catalog/"
}
}
}
}
+1
View File
@@ -26,6 +26,7 @@ describe('App', () => {
{
data: {
app: { title: 'Test' },
backend: { baseUrl: 'http://localhost:7000' },
},
context: 'test',
},
+7 -5
View File
@@ -56,6 +56,8 @@ export const apis = (config: ConfigApi) => {
// eslint-disable-next-line no-console
console.log(`Creating APIs for ${config.getString('app.title')}`);
const backendUrl = config.getString('backend.baseUrl');
const builder = ApiRegistry.builder();
const alertApi = builder.add(alertApiRef, new AlertApiForwarder());
@@ -78,7 +80,7 @@ export const apis = (config: ConfigApi) => {
builder.add(
googleAuthApiRef,
GoogleAuth.create({
apiOrigin: 'http://localhost:7000',
apiOrigin: backendUrl,
basePath: '/auth/',
oauthRequestApi,
}),
@@ -87,7 +89,7 @@ export const apis = (config: ConfigApi) => {
const githubAuthApi = builder.add(
githubAuthApiRef,
GithubAuth.create({
apiOrigin: 'http://localhost:7000',
apiOrigin: backendUrl,
basePath: '/auth/',
oauthRequestApi,
}),
@@ -96,7 +98,7 @@ export const apis = (config: ConfigApi) => {
builder.add(
oktaAuthApiRef,
OktaAuth.create({
apiOrigin: 'http://localhost:7000',
apiOrigin: backendUrl,
basePath: '/auth/',
oauthRequestApi,
}),
@@ -113,8 +115,8 @@ export const apis = (config: ConfigApi) => {
builder.add(
catalogApiRef,
new CatalogClient({
apiOrigin: 'http://localhost:3000',
basePath: '/catalog/api',
apiOrigin: backendUrl,
basePath: '/catalog',
}),
);