add test page

This commit is contained in:
androidlover5842
2026-01-26 16:24:16 +05:30
parent b2441fe291
commit 8997cffc16
2 changed files with 21 additions and 1 deletions

View File

@@ -0,0 +1,17 @@
package com.android.trisolarisserver.controller
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController
@RestController
class Health {
@GetMapping("/health")
fun health(): Map<String, String> {
return mapOf("status" to "ok")
}
@GetMapping("/")
fun root(): Map<String, String> {
return mapOf("status" to "ok")
}
}

View File

@@ -16,7 +16,10 @@ class SecurityConfig(
http http
.csrf { it.disable() } .csrf { it.disable() }
.sessionManagement { it.sessionCreationPolicy(SessionCreationPolicy.STATELESS) } .sessionManagement { it.sessionCreationPolicy(SessionCreationPolicy.STATELESS) }
.authorizeHttpRequests { it.anyRequest().authenticated() } .authorizeHttpRequests {
it.requestMatchers("/", "/health").permitAll()
it.anyRequest().authenticated()
}
.addFilterBefore(firebaseAuthFilter, UsernamePasswordAuthenticationFilter::class.java) .addFilterBefore(firebaseAuthFilter, UsernamePasswordAuthenticationFilter::class.java)
return http.build() return http.build()
} }