[Added] Most of the frontend, split up backend services
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.ninjaws.quiz.config;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
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
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**") // Allow all endpoints
|
||||
.allowedOrigins("http://localhost:4200") // Allow specific origin
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS") // Allow specific methods
|
||||
.allowedHeaders("*") // Allow all headers
|
||||
.allowCredentials(true); // Allow credentials
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user