Compare commits

..
12 Commits
Author SHA1 Message Date
2martens e88d98efc1 Dummy change
continuous-integration/drone/push Build is failing
2023-08-16 21:56:57 +02:00
2martens 8d545aa7fb Moved refreshable configuration to config sub-directory
continuous-integration/drone/push Build is failing
2023-08-16 21:54:42 +02:00
2martens a04094bc60 Move configserver import to bootstrap.yaml
continuous-integration/drone/push Build is failing
2023-08-16 21:09:15 +02:00
2martens 7d68612e57 Adjusted path to configserver
continuous-integration/drone/push Build is failing
2023-08-16 20:17:57 +02:00
2martens 64295db0e7 Added environments for http requests
continuous-integration/drone/push Build is failing
2023-08-16 20:08:54 +02:00
2martens 6dcd302ab7 OPTIONS method does not have to be allowed 2023-08-16 20:08:01 +02:00
2martens e50e769e22 Added production domain as allowed origin
continuous-integration/drone/push Build is failing
2023-08-16 12:52:17 +02:00
2martens b7c85e2368 Reversed code format 2023-08-16 01:00:48 +02:00
2martens a60289fc49 Added production server to OpenAPI
continuous-integration/drone/push Build is failing
2023-08-16 01:00:16 +02:00
2martens 9c4feee043 Use 127.0.0.1 as address
continuous-integration/drone/push Build is failing
2023-08-16 00:25:15 +02:00
2martens 1a50b40eaf Load log4j2.xml from resources
continuous-integration/drone/push Build is failing
2023-08-15 23:50:42 +02:00
2martens 3c7464a0cf Fix mainClassName
continuous-integration/drone/push Build is failing
2023-08-15 22:37:45 +02:00
8 changed files with 33 additions and 19 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
POST http://localhost:12000/wahlrecht/v1/calculate POST {{backend}}/wahlrecht/v1/calculate
Content-Type: application/json Content-Type: application/json
{ {
+2
View File
@@ -0,0 +1,2 @@
GET {{backend}}/wahlrecht/v1/elections
Content-Type: application/json
+8
View File
@@ -0,0 +1,8 @@
{
"dev": {
"backend": "http://localhost:12000"
},
"prod" : {
"backend": "https://api.2martens.de"
}
}
+2 -4
View File
@@ -31,10 +31,8 @@ jib {
} }
} }
container { container {
extraClasspath = listOf("/configmap") mainClass = "de.twomartens.wahlrecht.MainApplicationKt"
mainClass = "de.twomartens.wahlrecht.MainApplication"
jvmFlags = listOf("-XX:+UseContainerSupport", jvmFlags = listOf("-XX:+UseContainerSupport",
"-XX:MaxRAMPercentage=75.0", "-XX:MaxRAMPercentage=75.0")
"-Dlog4j.configurationFile=/configmap/log4j2.xml")
} }
} }
@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.security.OAuthFlows
import io.swagger.v3.oas.annotations.security.SecurityScheme import io.swagger.v3.oas.annotations.security.SecurityScheme
import io.swagger.v3.oas.models.OpenAPI import io.swagger.v3.oas.models.OpenAPI
import io.swagger.v3.oas.models.info.Info import io.swagger.v3.oas.models.info.Info
import io.swagger.v3.oas.models.servers.Server
import org.springframework.beans.factory.annotation.Value import org.springframework.beans.factory.annotation.Value
import org.springframework.context.annotation.Bean import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration import org.springframework.context.annotation.Configuration
@@ -35,5 +36,7 @@ open class OpenApiConfiguration {
.version(apiVersion) .version(apiVersion)
.description(apiDescription) .description(apiDescription)
) )
.addServersItem(Server().url("http://localhost:12000"))
.addServersItem(Server().url("https://api.2martens.de"))
} }
} }
@@ -16,10 +16,13 @@ open class WebConfiguration(private val headerInterceptorRest: HeaderInterceptor
override fun addCorsMappings(registry: CorsRegistry) { override fun addCorsMappings(registry: CorsRegistry) {
val registration = registry.addMapping("/**") val registration = registry.addMapping("/**")
registration.allowedMethods( registration.allowedMethods(
HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.GET.name(), HttpMethod.POST.name(),
HttpMethod.PUT.name(), HttpMethod.OPTIONS.name() HttpMethod.PUT.name(), HttpMethod.HEAD.name()
) )
registration.allowCredentials(true) registration.allowCredentials(true)
registration.allowedOrigins("http://localhost:4200") registration.allowedOrigins(
"http://localhost:4200",
"https://wahlrecht.2martens.de"
)
} }
} }
@@ -24,7 +24,9 @@ management:
spring: spring:
config: config:
import: "optional:configserver:http://localhost:8888/config" import:
- "classpath:config/wahlrecht.yaml"
- "optional:configserver:http://configserver:8888/config"
main: main:
banner-mode: off banner-mode: off
profiles: profiles:
@@ -41,16 +43,6 @@ spring:
name: wahlrecht name: wahlrecht
# properties for application
de.twomartens.wahlrecht:
defaultTimeZone: Europe/Berlin
greeting: "Hello %s"
statusprobe:
scheduleDuration: 60
maxKafkaFailureDuration: 5
maxBlobFailureCount: 5
maxFailurePercent: 50
springdoc: springdoc:
swagger-ui: swagger-ui:
display-request-duration: true display-request-duration: true
@@ -0,0 +1,8 @@
de.twomartens.wahlrecht:
defaultTimeZone: Europe/Berlin
greeting: "Hello %s"
statusprobe:
scheduleDuration: 60
maxKafkaFailureDuration: 5
maxBlobFailureCount: 5
maxFailurePercent: 50