Created
July 6, 2021 14:32
-
-
Save lidaling/f8ce09218ea27f3e858c38e2951773da to your computer and use it in GitHub Desktop.
spring routing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RestController | |
@RequestMapping(GraphDBController.DELEGATE_PREFIX) | |
@Api(value = "GraphDB", tags = { | |
"graphdb-Api" | |
}) | |
public class GraphDBController { | |
@Autowired | |
GraphProperties graphProperties; | |
public final static String DELEGATE_PREFIX = "/graphdb"; | |
@Autowired | |
private RoutingDelegate routingDelegate; | |
@RequestMapping(value = "/**", method = {RequestMethod.GET, RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE}, produces = MediaType.TEXT_PLAIN_VALUE) | |
public ResponseEntity catchAll(HttpServletRequest request, HttpServletResponse response) { | |
return routingDelegate.redirect(request, response, graphProperties.getGraphServer(), DELEGATE_PREFIX); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment