feat: Add database configuration and update routing for game creation
This commit is contained in:
28
knockoutwhistweb/conf/db.conf
Normal file
28
knockoutwhistweb/conf/db.conf
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
# Database configuration - PostgreSQL with environment variables
|
||||
db.default.driver=org.postgresql.Driver
|
||||
db.default.url=${?DATABASE_URL}
|
||||
db.default.username=${?DB_USER}
|
||||
db.default.password=${?DB_PASSWORD}
|
||||
db.default.password=""
|
||||
|
||||
# JPA/Hibernate configuration
|
||||
jpa.default=defaultPersistenceUnit
|
||||
|
||||
# Hibernate specific settings
|
||||
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
|
||||
hibernate.hbm2ddl.auto=update
|
||||
hibernate.show_sql=false
|
||||
hibernate.format_sql=true
|
||||
hibernate.use_sql_comments=true
|
||||
|
||||
# Connection pool settings
|
||||
db.default.hikaricp.maximumPoolSize=20
|
||||
db.default.hikaricp.minimumIdle=5
|
||||
db.default.hikaricp.connectionTimeout=30000
|
||||
db.default.hikaricp.idleTimeout=600000
|
||||
db.default.hikaricp.maxLifetime=1800000
|
||||
|
||||
# PostgreSQL specific settings
|
||||
db.default.hikaricp.connectionTestQuery="SELECT 1"
|
||||
db.default.hikaricp.poolName="KnockOutWhistPool"
|
||||
@@ -1,4 +1,5 @@
|
||||
include "application.conf"
|
||||
include "db.conf"
|
||||
|
||||
play.http.secret.key="zg8^v0R*:7-m.>^8T2B1q)sE3MV_9=M{K9zx8,<3}"
|
||||
|
||||
@@ -13,43 +14,16 @@ play.filters.cors {
|
||||
allowedHttpHeaders = ["Accept", "Content-Type", "Origin", "X-Requested-With"]
|
||||
}
|
||||
|
||||
# Database configuration - PostgreSQL with environment variables
|
||||
db.default.driver=org.postgresql.Driver
|
||||
db.default.url=${?DATABASE_URL}
|
||||
db.default.url="jdbc:postgresql://localhost:5432/knockoutwhist"
|
||||
db.default.username=${?DB_USER}
|
||||
db.default.username="postgres"
|
||||
db.default.password=${?DB_PASSWORD}
|
||||
db.default.password=""
|
||||
|
||||
# JPA/Hibernate configuration
|
||||
jpa.default=defaultPersistenceUnit
|
||||
|
||||
# Hibernate specific settings
|
||||
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
|
||||
hibernate.hbm2ddl.auto=update
|
||||
hibernate.show_sql=false
|
||||
hibernate.format_sql=true
|
||||
hibernate.use_sql_comments=true
|
||||
|
||||
# Connection pool settings
|
||||
db.default.hikaricp.maximumPoolSize=20
|
||||
db.default.hikaricp.minimumIdle=5
|
||||
db.default.hikaricp.connectionTimeout=30000
|
||||
db.default.hikaricp.idleTimeout=600000
|
||||
db.default.hikaricp.maxLifetime=1800000
|
||||
|
||||
# PostgreSQL specific settings
|
||||
db.default.hikaricp.connectionTestQuery="SELECT 1"
|
||||
db.default.hikaricp.poolName="KnockOutWhistPool"
|
||||
|
||||
# OpenID Connect Configuration
|
||||
openid {
|
||||
|
||||
selectUserRoute="https://knockout.janis-eccarius.de/select-user"
|
||||
|
||||
discord {
|
||||
clientId = ${?DISCORD_CLIENT_ID}
|
||||
clientSecret = ${?DISCORD_CLIENT_SECRET}
|
||||
redirectUri = ${?DISCORD_REDIRECT_URI}
|
||||
redirectUri = "http://localhost:9000/auth/discord/callback"
|
||||
redirectUri = "https://knockout.janis-eccarius.de/auth/discord/callback"
|
||||
}
|
||||
|
||||
keycloak {
|
||||
@@ -57,6 +31,6 @@ openid {
|
||||
clientSecret = "your-keycloak-client-secret"
|
||||
redirectUri = "https://knockout.janis-eccarius.de/api/auth/keycloak/callback"
|
||||
authUrl = ${?KEYCLOAK_AUTH_URL}
|
||||
authUrl = "http://localhost:8080/realms/master"
|
||||
authUrl = "https://identity.janis-eccarius.de/realms/master"
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,4 @@
|
||||
# Routes
|
||||
# This file defines all application routes (Higher priority routes first)
|
||||
# https://www.playframework.com/documentation/latest/ScalaRouting
|
||||
# ~~~~
|
||||
|
||||
# For the javascript routing
|
||||
GET /assets/js/routes controllers.JavaScriptRoutingController.javascriptRoutes()
|
||||
# Primary routes
|
||||
GET / controllers.MainMenuController.index()
|
||||
GET /assets/*file controllers.Assets.versioned(path="/public", file: Asset)
|
||||
|
||||
# Main menu routes
|
||||
GET /mainmenu controllers.MainMenuController.mainMenu()
|
||||
GET /rules controllers.MainMenuController.rules()
|
||||
GET /navSPA/:pType controllers.MainMenuController.navSPA(pType)
|
||||
|
||||
# Create game rounds
|
||||
POST /createGame controllers.MainMenuController.createGame()
|
||||
POST /joinGame/:gameId controllers.MainMenuController.joinGame(gameId: String)
|
||||
|
||||
@@ -29,9 +14,6 @@ GET /auth/:provider/callback controllers.OpenIDController.callback(provi
|
||||
GET /select-username controllers.OpenIDController.selectUsername()
|
||||
POST /submit-username controllers.OpenIDController.submitUsername()
|
||||
|
||||
# In-game routes
|
||||
GET /game/:id controllers.IngameController.game(id: String)
|
||||
|
||||
# Websocket
|
||||
GET /websocket controllers.WebsocketController.socket()
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
include "application.conf"
|
||||
include "db.conf"
|
||||
|
||||
play.http.context="/api"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user