Skip to content

Commit

Permalink
Fix : cors 수정 #288
Browse files Browse the repository at this point in the history
Fix : cors 수정 #288
  • Loading branch information
begong313 authored May 30, 2024
2 parents 2baa4b8 + a6ce918 commit e2068e3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ server/src/main/java/com/capstone/server/dataInitializer/CCTVInitializer.java
/ai/TextReID/datasets/imgs
ai/imageSearch/results.json
ai/imageSearch/search_result_grid.jpg
/myenv
/test
ai/yolov8/.env
11 changes: 5 additions & 6 deletions server/src/main/java/com/capstone/server/config/WebConfig.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
package com.capstone.server.config;

import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import lombok.RequiredArgsConstructor;

@Configuration
@RequiredArgsConstructor
public class WebConfig implements WebMvcConfigurer {

@Override
public void addCorsMappings(CorsRegistry registry) {
registry
.addMapping("/**")
.allowedHeaders("*")
.allowedOrigins("*") // TODO: url 수정
.allowedMethods("*");
.addMapping("/**")
.allowedHeaders("*")
.allowedOrigins("https://suhwani.me", "https://probee.co.kr", "http://localhost:3000") // TODO: url 수정
.allowedMethods("*");
}
}

0 comments on commit e2068e3

Please sign in to comment.