Skip to content

Commit

Permalink
feat: fix app withour slash (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolagospagopa authored Jun 4, 2022
1 parent 3549def commit 375c0f8
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.8"
services:
devops-springboot-gitlab-workflow:
image: "devops-springboot-gitlab-workflow:latest"
image: "ghcr.io/pagopa/devops-springboot-gitlab-workflow:0.1.3"
# build:
# dockerfile: ./Dockerfile
# context: .
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ public class AppController {
@Value("${MY_ENV_1:}")
private String myEnv1;

@GetMapping(path = "", produces=MediaType.APPLICATION_JSON_VALUE)
public Map<String, String> mainApp()
{
return root();
}

@GetMapping(path = "/", produces=MediaType.APPLICATION_JSON_VALUE)
public Map<String, String> root()
{
Expand Down
16 changes: 16 additions & 0 deletions src/main/java/it/pagopa/devops/springbootshowcase/WebConfig.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package it.pagopa.devops.springbootshowcase;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@EnableWebMvc
public class WebConfig implements WebMvcConfigurer {

@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseTrailingSlashMatch(true);
}
}

0 comments on commit 375c0f8

Please sign in to comment.