From 2f7516a0af0eaca205b71415a0910084cb452d33 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Thu, 9 Jun 2022 20:09:43 +0430 Subject: wip --- src/main/java/com/terminaldweller/doc/DocController.java | 2 +- src/main/java/com/terminaldweller/main/DevConfiguration.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/com') diff --git a/src/main/java/com/terminaldweller/doc/DocController.java b/src/main/java/com/terminaldweller/doc/DocController.java index 80e63a8..f45ba52 100644 --- a/src/main/java/com/terminaldweller/doc/DocController.java +++ b/src/main/java/com/terminaldweller/doc/DocController.java @@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.RestController; /** The document controller class. */ @RestController -@CrossOrigin(origins = "https://localhost:7080") +@CrossOrigin(origins = "https://localhost:7080, https://editor.terminaldweller.com") @RequestMapping(path = "api/v1/doc") public class DocController { private final DocService docService; diff --git a/src/main/java/com/terminaldweller/main/DevConfiguration.java b/src/main/java/com/terminaldweller/main/DevConfiguration.java index 461e7bf..6f0137b 100644 --- a/src/main/java/com/terminaldweller/main/DevConfiguration.java +++ b/src/main/java/com/terminaldweller/main/DevConfiguration.java @@ -3,9 +3,11 @@ package com.terminaldweller; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Profile; 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 @Profile("development") public class DevConfiguration implements WebMvcConfigurer { @@ -13,7 +15,7 @@ public class DevConfiguration implements WebMvcConfigurer { public void addCorsMappings(CorsRegistry registry) { registry .addMapping("/**") - .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") - .allowedOrigins("https://localhost:7080, https://editor.terminaldweller.com"); + .allowedOrigins("https://localhost:7080, https://editor.terminaldweller.com") + .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS"); } } -- cgit v1.2.3