Refactoring backend (#42)
All checks were successful
Build and test backend / Build-backend (push) Successful in 2m7s
Build and test backend / Test-backend (push) Successful in 1m22s
Build and test FrontEnd / Build-frontend (push) Successful in 22s
Build and test FrontEnd / Test-frontend (push) Successful in 22s
deploy to production / deploy-frontend (push) Successful in 24s
deploy to production / deploy-backend (push) Successful in 1m28s

removing cors fails.
refactoring ping as a proposal for rest endpoints locations

Reviewed-on: #42
Reviewed-by: Maxime <231026@umons.ac.be>
Co-authored-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
Co-committed-by: Anthony Debucquoy <debucquoy.anthony@gmail.com>
This commit is contained in:
Debucquoy Anthony 2024-03-01 18:43:56 +01:00 committed by Debucquoy Anthony
parent 0de7b69b1b
commit caf11b5b19
4 changed files with 6 additions and 18 deletions

View File

@ -4,15 +4,15 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import ovh.herisson.Clyde.Ping; import ovh.herisson.Clyde.Responses.PingResponse;
@RestController @RestController
@CrossOrigin(origins = "http://localhost:5173") @CrossOrigin(origins = "http://localhost:5173")
public class PingController { public class PingController {
@GetMapping("/ping") @GetMapping("/ping")
public Ping ping(){ public PingResponse ping(){
return new Ping(1, "pong"); return new PingResponse(1, "pong");
} }
} }

View File

@ -34,16 +34,4 @@ public class JdbcConfig {
return source; return source;
} }
@Bean
public WebMvcConfigurer corsConfigurer() {
return new WebMvcConfigurer() {
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/greeting-javaconfig").allowedOrigins("*");
}
};
}
} }

View File

@ -1,3 +0,0 @@
package ovh.herisson.Clyde;
public record Ping(int id, String txt){};

View File

@ -0,0 +1,3 @@
package ovh.herisson.Clyde.Responses;
public record PingResponse(int id, String txt){};