This commit is contained in:
@@ -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> {
|
||||||
|
|||||||
Reference in New Issue
Block a user