Skip to content

Commit

Permalink
feat : 배포용 CORS 설정
Browse files Browse the repository at this point in the history
아 이거 배포용이랑 로컬 개발용이랑 이래서 구분해야하는구나.... 스프링은 대충 2개다 처리하면 되는데 front는 모르겠다
  • Loading branch information
Doncham committed Mar 15, 2024
1 parent 54094c2 commit d6b247f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class WebConfig implements WebMvcConfigurer{
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**")
// .allowedOrigins("http://localhost") // local용
.allowedOrigins("http://sharenote.shop") // 배포시 변경
.allowedOrigins("http://sharenote.shop","https://sharenote.shop") // 배포시 변경
.allowedMethods("GET", "POST", "PUT", "DELETE")
.allowedHeaders("Authorization", "Content-Type")
.exposedHeaders("Custom-Header")
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/setupProxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module.exports = function(app) {
app.use(
'/api',
createProxyMiddleware({
target: 'http://sharenote.shop:8080', // 서버 URL or localhost:설정한포트번호
target: 'https://sharenote.shop:8080', // 서버 URL or localhost:설정한포트번호
changeOrigin: true,
})
);
Expand Down

0 comments on commit d6b247f

Please sign in to comment.