From 7f029b9421ed940f5ca3e7be1e691f5fc2e006a7 Mon Sep 17 00:00:00 2001 From: terminaldweller Date: Fri, 3 Jun 2022 22:56:37 +0430 Subject: server config --- .../com/terminaldweller/main/DevConfiguration.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/main/java/com/terminaldweller/main/DevConfiguration.java diff --git a/src/main/java/com/terminaldweller/main/DevConfiguration.java b/src/main/java/com/terminaldweller/main/DevConfiguration.java new file mode 100644 index 0000000..461e7bf --- /dev/null +++ b/src/main/java/com/terminaldweller/main/DevConfiguration.java @@ -0,0 +1,19 @@ +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.WebMvcConfigurer; + +@Configuration +@Profile("development") +public class DevConfiguration implements WebMvcConfigurer { + + @Override + public void addCorsMappings(CorsRegistry registry) { + registry + .addMapping("/**") + .allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") + .allowedOrigins("https://localhost:7080, https://editor.terminaldweller.com"); + } +} -- cgit v1.2.3