Skip to content

Commit

Permalink
basePath: githubDeployment ? '/formswizard' : '/'
Browse files Browse the repository at this point in the history
  • Loading branch information
johannesloetzsch committed Sep 11, 2023
1 parent 3a997b7 commit ad4ab0e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion backend/src/formswizard/server.clj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

(def cors-config {:cors-config {:allowed-request-methods [:post :put :get]
:allowed-request-headers ["Authorization" "Content-Type"]
:origins ["http://localhost:4000" "http://localhost:3000" "http://localhost:3001" "http://localhost:3002"]
:origins ["http://localhost:4000" "http://localhost:3000" "http://localhost:3001" "http://localhost:3002"
"https://formswizard.github.io" "https://formswizard.afg.mission-lifeline.de"] ;; TODO from config
:max-age 300}})

(def app
Expand Down
2 changes: 1 addition & 1 deletion frontend/apps/demo/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export default function Page() {
return <>
<p>TODO: here we should add a welcome page and a brief introduction</p>

<a href="./new">Create a new form</a>
<a href="./new.html">Create a new form</a>

<p>TODO: in future we list the history of previousliy created forms to reopen it</p>
</>
Expand Down
21 changes: 15 additions & 6 deletions frontend/apps/demo/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
module.exports = {
reactStrictMode: true,
transpilePackages: [],
output: 'export',
basePath: '/formswizard'
};
module.exports = (phase, { defaultConfig }) => {
const githubDeployment = process.env.GITHUB_ACTIONS;
console.log({githubDeployment});

const nextConfig = {

reactStrictMode: true,
transpilePackages: [],
output: 'export',
basePath: githubDeployment ? '/formswizard' : '/',

...defaultConfig
}
return nextConfig
}
4 changes: 1 addition & 3 deletions frontend/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,8 @@ in pkgs.mkShell {
pnpm turbo run build --filter='./apps/*'
mkdir apps/demo/out/formswizard
mv apps/demo/out/* apps/demo/out/formswizard || true
(cd apps/demo/out; python -m http.server 8080 || true) &
xdg-open http://localhost:8080/formswizard/new.html &
xdg-open http://localhost:8080/new.html &
cd apps/demo
Expand Down

0 comments on commit ad4ab0e

Please sign in to comment.