Skip to content

Commit

Permalink
SMA-101: added env variables for different environments
Browse files Browse the repository at this point in the history
  • Loading branch information
MatejFrnka committed Apr 21, 2024
1 parent a2ce89d commit 4aac6c0
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
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=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
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
}

0 comments on commit 4aac6c0

Please sign in to comment.