diff --git a/backend/sportsmatch/src/main/resources/application-prod.properties b/backend/sportsmatch/src/main/resources/application-prod.properties new file mode 100644 index 00000000..fe3e4b6c --- /dev/null +++ b/backend/sportsmatch/src/main/resources/application-prod.properties @@ -0,0 +1,22 @@ +spring.datasource.url=jdbc:postgresql://quirky-bugbear-7185.7tc.aws-eu-central-1.cockroachlabs.cloud:26257/sportsmingle?sslmode=verify-full +spring.datasource.username=matt +spring.datasource.password={ask for it} +spring.jpa.hibernate.ddl-auto=update +spring.datasource.driver-class-name=org.postgresql.Driver +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.format_sql=true +spring.jpa.properties.hibernate.use_sql_comments=true +spring.jpa.properties.hibernate.generate_statistics=true +spring.h2.console.enabled=true +spring.mvc.hiddenmethod.filter.enabled=true + +spring.jpa.defer-datasource-initialization=true +spring.sql.init.mode=always + +app.sportsmingle.initialization.database-init=true +app.sportsmingle.jwt.secret=j20qeDeHCI6vGstychuoW2mknL8kmmQW66UCTDSz4jNfSNdd1eUpqEsUfVkOq9tO +app.sportsmingle.frontend.url=sportsmingle.app + +app.sportsmingle.num-game-threshold=5,15,25 +app.sportsmingle.k-factors=25.0,15.0,10.0 +app.sportsmingle.k-factor-default=5.0 \ No newline at end of file diff --git a/frontend/sportsmatch-app/.env b/frontend/sportsmatch-app/.env new file mode 100644 index 00000000..ed5ee609 --- /dev/null +++ b/frontend/sportsmatch-app/.env @@ -0,0 +1 @@ +VITE_BACKEND_URL=http://localhost:8080 \ No newline at end of file diff --git a/frontend/sportsmatch-app/.env.production b/frontend/sportsmatch-app/.env.production new file mode 100644 index 00000000..408a3f1b --- /dev/null +++ b/frontend/sportsmatch-app/.env.production @@ -0,0 +1 @@ +VITE_BACKEND_URL= \ No newline at end of file diff --git a/frontend/sportsmatch-app/src/App.tsx b/frontend/sportsmatch-app/src/App.tsx index 8a040528..5b8d2a61 100644 --- a/frontend/sportsmatch-app/src/App.tsx +++ b/frontend/sportsmatch-app/src/App.tsx @@ -14,6 +14,7 @@ import HostEvent from './pages/HostEvent' import { useEffect } from 'react' function App() { + OpenAPI.BASE = import.meta.env.VITE_BACKEND_URL OpenAPI.TOKEN = localStorage.getItem('token')! useEffect(() => { diff --git a/frontend/sportsmatch-app/src/vite-env.d.ts b/frontend/sportsmatch-app/src/vite-env.d.ts index 11f02fe2..401a59ba 100644 --- a/frontend/sportsmatch-app/src/vite-env.d.ts +++ b/frontend/sportsmatch-app/src/vite-env.d.ts @@ -1 +1,9 @@ /// + +interface ImportMetaEnv { + readonly VITE_BACKEND_URL: string +} + +interface ImportMeta { + readonly env: ImportMetaEnv +}