Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 6a1a8cd7

Přidáno uživatelem Jakub Šmíd před asi 2 roky(ů)

Database exported to script
- removed initialization from application
- updated docker-compose.yml to create volume and add data from script

re #9746

Zobrazit rozdíly:

backend/src/main/java/cz/zcu/kiv/backendapi/config/CorsConfig.java
1 1
package cz.zcu.kiv.backendapi.config;
2 2

  
3 3
import org.springframework.context.annotation.Configuration;
4
import org.springframework.http.HttpMethod;
4 5
import org.springframework.web.servlet.config.annotation.CorsRegistry;
5 6
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
6 7
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
7 8

  
8
// TODO this needs to be configured for production and localhost development!
9
/**
10
 * Configuration class for CORS
11
 */
9 12
@Configuration
10 13
@EnableWebMvc
11 14
public class CorsConfig implements WebMvcConfigurer {
......
14 17
    public void addCorsMappings(CorsRegistry registry) {
15 18
        registry.addMapping("/**")
16 19
                .allowedOrigins("*")
17
                .allowedMethods("GET", "POST", "DELETE", "PUT", "PATCH");
20
                .allowedMethods(HttpMethod.GET.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name(), HttpMethod.PUT.name(), HttpMethod.PATCH.name());
18 21
    }
19 22
}

Také k dispozici: Unified diff