ranveer-kumar / spark-cms-backend

0 stars 0 forks source link

Allow CORS #18

Closed ranveer-kumar closed 2 years ago

ranveer-kumar commented 2 years ago

Enabled for All () for now. To restrict limited domains needs to be pass the list (replace with domain name in string as List) in the following file.

package com.spark.cms.config Class Name: CorsConfig

  `@Bean
public WebMvcConfigurer corsConfigurer() {
    return new WebMvcConfigurer() {
        @Override
        public void addCorsMappings(CorsRegistry registry) {
            registry.addMapping("/graphql").allowedOrigins("*****"); //registry.addMapping("/graphql").allowedOrigins("http://localhost:4200"); 
        }
    };
}`