web config :)

This commit is contained in:
Guams 2024-12-10 22:22:56 +01:00
parent 38b0f46f7f
commit acd85c93e0
2 changed files with 16 additions and 6 deletions

View File

@ -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
}
}

View File

@ -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);