From eeb4828c329001f53fcb2a37aa3f01ef61bf0f8c Mon Sep 17 00:00:00 2001 From: Adnan Abdulhussein Date: Tue, 14 Nov 2017 18:53:02 +0000 Subject: [PATCH] use hash router to support serving from subpath For KubeApps, we mount Kubeless UI under a /kubeless subpath so these changes are required to make Kubeless UI work correctly under subpaths. - also switch to relative route for calling k8s API proxy - updates docker-compose to point to dev dockerfile (oddly named -prod) --- docker-compose.yml | 2 +- src/components/AppContainer.js | 4 ++-- src/utils/Api.js | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 27b743e..7564907 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: image: kubeless-ui-dev build: context: . - dockerfile: Dockerfile + dockerfile: Dockerfile-prod command: bash -c "yarn install && npm rebuild node-sass && yarn run dev" environment: NODE_ENV: development diff --git a/src/components/AppContainer.js b/src/components/AppContainer.js index b160a8c..cc0f203 100644 --- a/src/components/AppContainer.js +++ b/src/components/AppContainer.js @@ -16,7 +16,7 @@ limitations under the License. // @flow import React, { Component } from 'react' -import { browserHistory, Router } from 'react-router' +import { hashHistory, Router } from 'react-router' import { Provider } from 'react-redux' import getMuiTheme from 'material-ui/styles/getMuiTheme' import lightBaseTheme from 'material-ui/styles/baseThemes/lightBaseTheme' @@ -48,7 +48,7 @@ export default class AppContainer extends Component {
- +
diff --git a/src/utils/Api.js b/src/utils/Api.js index d3b8881..0caedf3 100644 --- a/src/utils/Api.js +++ b/src/utils/Api.js @@ -27,7 +27,7 @@ export default class Api { url: URL, method, json } - return fetch('/proxy', { + return fetch('proxy', { method: 'post', headers, body: JSON.stringify(forwardBody)