Skip to content

Commit

Permalink
Support custom base path
Browse files Browse the repository at this point in the history
  • Loading branch information
mpgxvii committed Oct 1, 2024
1 parent c327495 commit 2779a6f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
5 changes: 5 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ORY_SDK_URL=http://localhost:4433
HYDRA_ADMIN_URL=http://localhost:4445
HYDRA_PUBLIC_URL=http://localhost:4444
BASE_PATH=/kratos-ui
NEXT_PUBLIC_KRATOS_PUBLIC_URL=http://localhost:4433
4 changes: 4 additions & 0 deletions pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "../styles/globals.css"
import { theme, globalStyles, ThemeProps } from "@ory/themes"
import type { AppProps } from "next/app"
import Head from "next/head"
import { ToastContainer } from "react-toastify"
import "react-toastify/dist/ReactToastify.css"
import { ThemeProvider } from "styled-components"
Expand All @@ -13,6 +14,9 @@ const GlobalStyle = createGlobalStyle((props: ThemeProps) =>
function MyApp({ Component, pageProps }: AppProps) {
return (
<div data-testid="app-react">
<Head>
<base href="/kratos-ui/" />
</Head>
<ThemeProvider theme={theme}>
<GlobalStyle />
<Component {...pageProps} />
Expand Down
17 changes: 0 additions & 17 deletions pages/api/.ory/[...paths].ts

This file was deleted.

2 changes: 1 addition & 1 deletion pkg/styled/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export const DocsButton = ({
onClick={onClick}
disabled={disabled}
data-testid={testid}
href={href}
href={process.env.BASE_PATH + href}
>
{title}
</TextLeftButton>
Expand Down

0 comments on commit 2779a6f

Please sign in to comment.