diff --git a/src/main/java/com/guams/review/configuration/WebConfig.java b/src/main/java/com/guams/review/configuration/WebConfig.java new file mode 100644 index 0000000..38057c4 --- /dev/null +++ b/src/main/java/com/guams/review/configuration/WebConfig.java @@ -0,0 +1,16 @@ +package com.guams.review.configuration; + +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("/**"); // autorise toutes les requĂȘtes externe + } +} \ No newline at end of file diff --git a/src/main/resources/script.sql b/src/main/resources/script.sql index 7ee4925..0c3bf9e 100644 --- a/src/main/resources/script.sql +++ b/src/main/resources/script.sql @@ -1,10 +1,7 @@ -drop extension if exists pgcrypto; drop table if exists publication; drop table if exists post; drop table if exists author; -create extension if not exists pgcrypto; - create table author ( id uuid default gen_random_uuid() primary key, @@ -31,6 +28,3 @@ create table publication foreign key (author_fk) references author (id), foreign key (post_fk) references post (id) ); - --- insert into author (name, password, profile_picture) --- values ('John Doe', crypt('your_password', gen_salt('bf')), null);