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

SMA-101: added env variables for different environments #80

Merged
merged 2 commits into from
Apr 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
22 changes: 22 additions & 0 deletions backend/sportsmatch/src/main/resources/application-prod.properties
Original file line number Diff line number Diff line change
@@ -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={ask for it}
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
1 change: 1 addition & 0 deletions frontend/sportsmatch-app/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_BACKEND_URL=http://localhost:8080
1 change: 1 addition & 0 deletions frontend/sportsmatch-app/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
VITE_BACKEND_URL=
1 change: 1 addition & 0 deletions frontend/sportsmatch-app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand Down
8 changes: 8 additions & 0 deletions frontend/sportsmatch-app/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
/// <reference types="vite/client" />

interface ImportMetaEnv {
readonly VITE_BACKEND_URL: string
}

interface ImportMeta {
readonly env: ImportMetaEnv
}
Loading