From acd85c93e0bc371f27915d97cabf4afe8aaee4e9 Mon Sep 17 00:00:00 2001 From: Guams Date: Tue, 10 Dec 2024 22:22:56 +0100 Subject: [PATCH] web config :) --- .../guams/review/configuration/WebConfig.java | 16 ++++++++++++++++ src/main/resources/script.sql | 6 ------ 2 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 src/main/java/com/guams/review/configuration/WebConfig.java 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);