zoukankan      html  css  js  c++  java
  • [Spring Boot] Set Context path for application in application.properties

    If you were using Microservice with Spring Boot to build different REST API endpoints, context path might help you.

    For example, you have two endpoints, each in a Microservice application:

    1. team

    2. players

    They both have sub-route such as:

    • [GET] info
    • [POST] new

    For each application you can set up:

    team/application.properties:

    # all the requests should be prefixed with /team
    server.servlet.context-path=/team

    players/application.properties:

    # all the requests should be prefixed with /team
    server.servlet.context-path=/players

    Now when you access those endpoints, you should add prefix:

    localhost:8080/team/info
  • 相关阅读:
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    HTML5
    53.Maximum Subarray
  • 原文地址:https://www.cnblogs.com/Answer1215/p/10984551.html
Copyright © 2011-2022 走看看