Ajout du CORS Pour le dev local + toastify + exmpl
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				Build and test backend / Build-backend (pull_request) Successful in 1m43s
				
			
		
			
				
	
				Build and test backend / Test-backend (pull_request) Successful in 1m39s
				
			
		
			
				
	
				Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
				
			
		
			
				
	
				Build and test FrontEnd / Test-frontend (pull_request) Successful in 23s
				
			
		
			
				
	
				Build and test backend / Build-backend (push) Successful in 1m54s
				
			
		
			
				
	
				Build and test backend / Test-backend (push) Successful in 1m15s
				
			
		
			
				
	
				deploy to production / deploy-frontend (push) Successful in 23s
				
			
		
			
				
	
				deploy to production / deploy-backend (push) Successful in 1m58s
				
			
		
			
				
	
				Build and test FrontEnd / Build-frontend (push) Successful in 22s
				
			
		
			
				
	
				Build and test FrontEnd / Test-frontend (push) Successful in 22s
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	Build and test backend / Build-backend (pull_request) Successful in 1m43s
				
			Build and test backend / Test-backend (pull_request) Successful in 1m39s
				
			Build and test FrontEnd / Build-frontend (pull_request) Successful in 23s
				
			Build and test FrontEnd / Test-frontend (pull_request) Successful in 23s
				
			Build and test backend / Build-backend (push) Successful in 1m54s
				
			Build and test backend / Test-backend (push) Successful in 1m15s
				
			deploy to production / deploy-frontend (push) Successful in 23s
				
			deploy to production / deploy-backend (push) Successful in 1m58s
				
			Build and test FrontEnd / Build-frontend (push) Successful in 22s
				
			Build and test FrontEnd / Test-frontend (push) Successful in 22s
				
			tout est dans le titre
This commit is contained in:
		| @ -19,7 +19,7 @@ dependencies { | ||||
| 	implementation("org.springframework.boot:spring-boot-starter-jdbc") | ||||
| 	implementation("org.springframework.boot:spring-boot-starter-mail") | ||||
| 	implementation("org.springframework.boot:spring-boot-starter-web") | ||||
| 	implementation("org.springframework.session:spring-session-jdbc") | ||||
| 	// implementation("org.springframework.session:spring-session-jdbc") | ||||
| 	developmentOnly("org.springframework.boot:spring-boot-devtools") | ||||
| 	developmentOnly("org.springframework.boot:spring-boot-docker-compose") | ||||
| 	runtimeOnly("org.postgresql:postgresql") | ||||
|  | ||||
| @ -1,16 +1,18 @@ | ||||
| package ovh.herisson.Clyde.EndPoints; | ||||
|  | ||||
| import org.springframework.web.bind.annotation.GetMapping; | ||||
| import org.springframework.web.bind.annotation.CrossOrigin; | ||||
| import org.springframework.web.bind.annotation.RestController; | ||||
|  | ||||
| import ovh.herisson.Clyde.Ping; | ||||
|  | ||||
| @RestController | ||||
| @CrossOrigin(origins = "http://localhost:5173") | ||||
| public class PingController { | ||||
|  | ||||
| 	@GetMapping("/ping") | ||||
| 	public Ping ping(){ | ||||
| 		return new Ping(1, "test"); | ||||
| 		return new Ping(1, "pong"); | ||||
| 	} | ||||
| 	 | ||||
| } | ||||
|  | ||||
| @ -5,6 +5,8 @@ import javax.sql.DataSource; | ||||
| import org.springframework.context.annotation.Bean; | ||||
| import org.springframework.context.annotation.Configuration; | ||||
| import org.springframework.jdbc.datasource.DriverManagerDataSource; | ||||
| import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||||
| import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||||
|  | ||||
| @Configuration | ||||
| public class JdbcConfig { | ||||
| @ -20,4 +22,15 @@ public class JdbcConfig { | ||||
| 		return source; | ||||
| 	} | ||||
|  | ||||
|  | ||||
| 	@Bean | ||||
| 	public WebMvcConfigurer corsConfigurer() { | ||||
| 		return new WebMvcConfigurer() { | ||||
| 			@Override | ||||
| 			public void addCorsMappings(CorsRegistry registry) { | ||||
| 				registry.addMapping("/greeting-javaconfig").allowedOrigins("*"); | ||||
| 			} | ||||
| 		}; | ||||
| 	} | ||||
|  | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user