add feature with claude code #34
@@ -8,13 +8,16 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
|||||||
@Configuration
|
@Configuration
|
||||||
public class CorsConfig implements WebMvcConfigurer {
|
public class CorsConfig implements WebMvcConfigurer {
|
||||||
|
|
||||||
@Value("${vaessl.frontend-url}")
|
@Value("${vaessl.frontend-local-url}")
|
||||||
private String frontendUrl;
|
private String frontendLocalUrl;
|
||||||
|
|
||||||
|
@Value("${vaessl.frontend-public-url}")
|
||||||
|
private String frontendPublicUrl;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addCorsMappings(CorsRegistry registry) {
|
public void addCorsMappings(CorsRegistry registry) {
|
||||||
registry.addMapping("/**")
|
registry.addMapping("/**")
|
||||||
.allowedOrigins(frontendUrl, "http://192.168.1.208:5173", "https://5173.code-server.kasuns.website")
|
.allowedOrigins(frontendLocalUrl, frontendPublicUrl)
|
||||||
.allowedMethods("GET", "POST", "DELETE", "OPTIONS")
|
.allowedMethods("GET", "POST", "DELETE", "OPTIONS")
|
||||||
.allowedHeaders("Content-Type", "Accept")
|
.allowedHeaders("Content-Type", "Accept")
|
||||||
.allowCredentials(true);
|
.allowCredentials(true);
|
||||||
|
|||||||
@@ -5,8 +5,13 @@
|
|||||||
"description": "A description for 'spring.session.store-type'"
|
"description": "A description for 'spring.session.store-type'"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "vaessl.frontend-url",
|
"name": "vaessl.frontend-local-url",
|
||||||
"type": "java.lang.String",
|
"type": "java.lang.String",
|
||||||
"description": "A description for 'vaessl.frontend-url'"
|
"description": "A description for 'vaessl.frontend-local-url'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "vaessl.frontend-public-url",
|
||||||
|
"type": "java.lang.String",
|
||||||
|
"description": "A description for 'vaessl.frontend-public-url'"
|
||||||
}
|
}
|
||||||
]}
|
]}
|
||||||
@@ -30,4 +30,5 @@ server:
|
|||||||
servlet:
|
servlet:
|
||||||
context-path: /api
|
context-path: /api
|
||||||
vaessl:
|
vaessl:
|
||||||
frontend-url: ${FRONTEND_URL:http://192.168.1.208:5173/}
|
frontend-local-url: ${FRONTEND_LOCAL_URL}
|
||||||
|
frontend-public-url: ${FRONTEND_PUBLIC_URL}
|
||||||
|
|||||||
Reference in New Issue
Block a user