add test page
This commit is contained in:
@@ -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")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user