Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support path based routing #165

Merged
merged 8 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ WORKDIR /build
COPY . .
RUN yarn install
RUN test -e .env || cp .env.example .env
ARG VITE_USE_RELATIVE_BASE_URL VITE_DOCS_QA_STANDALONE_PATH
ENV VITE_USE_RELATIVE_BASE_URL=${VITE_USE_RELATIVE_BASE_URL} \
VITE_DOCS_QA_STANDALONE_PATH=${VITE_DOCS_QA_STANDALONE_PATH}
RUN yarn build

FROM node:18.2.0 AS production-stage
Expand Down
4 changes: 1 addition & 3 deletions frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ import history from './router/history'
import { DOCS_QA_STANDALONE_PATH } from './stores/constants'

const getBaseName = () => {
return DOCS_QA_STANDALONE_PATH
? '/' + DOCS_QA_STANDALONE_PATH
: undefined
return DOCS_QA_STANDALONE_PATH ? '/' + DOCS_QA_STANDALONE_PATH : undefined
}

function App() {
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/stores/constants.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// docs qa
export const IS_DOCS_QA_REDIRECT_ENABLED =
import.meta.env.VITE_DOCS_QA_ENABLE_REDIRECT === 'true'
export const DOCS_QA_STANDALONE_PATH =
import.meta.env.VITE_DOCS_QA_STANDALONE_PATH || 'docs-qa'
import.meta.env.VITE_DOCS_QA_STANDALONE_PATH
export const DOCS_QA_MAX_UPLOAD_SIZE_MB = parseInt(
import.meta.env.VITE_DOCS_QA_MAX_UPLOAD_SIZE_MB || '2'
)