Updates CORS for non-localhost access
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
parent
7ae491da43
commit
8a8a8f15b1
14
src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt
Normal file
14
src/main/kotlin/net/halfbinary/tmnt/config/WebConfig.kt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package net.halfbinary.tmnt.config
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Configuration
|
||||||
|
import org.springframework.web.servlet.config.annotation.CorsRegistry
|
||||||
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc
|
||||||
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
@EnableWebMvc
|
||||||
|
class WebConfig : WebMvcConfigurer {
|
||||||
|
override fun addCorsMappings(registry: CorsRegistry) {
|
||||||
|
registry.addMapping("/**")
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,7 +12,6 @@ import org.springframework.web.bind.annotation.RestController
|
|||||||
|
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/movies")
|
@RequestMapping("/movies")
|
||||||
@CrossOrigin(origins = ["http://localhost:5173"])
|
|
||||||
class MoviesController(val moviesService: MoviesService) {
|
class MoviesController(val moviesService: MoviesService) {
|
||||||
@GetMapping
|
@GetMapping
|
||||||
fun getAllMovies(): List<MovieResponse> {
|
fun getAllMovies(): List<MovieResponse> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user