Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure application base path #14

Open
AlexOreshkevich opened this issue Dec 1, 2022 · 0 comments
Open

Configure application base path #14

AlexOreshkevich opened this issue Dec 1, 2022 · 0 comments
Assignees

Comments

@AlexOreshkevich
Copy link
Member

Make Swagger available on the custom root endpoint

@Configuration
@EnableWebFlux
public class WebConfig implements WebFluxConfigurer {

  @NotNull
  @Value("${spring.webflux.base-path}")
  private String basePath;

  @Override
  public void configurePathMatching(PathMatchConfigurer configurer) {
    configurer
        .setUseCaseSensitiveMatch(true)
        .setUseTrailingSlashMatch(false)
        .addPathPrefix(basePath,
            HandlerTypePredicate.forAnnotation(RestController.class));
  }
}

application.yml

spring:
  webflux:
    base-path: /demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants