I have a controller with the following GetMapping
@GetMapping(value = "/{path}")
public ResponseEntity searchAPI(@PathVariable("path") String API_NAME)
but I have to exclude /index.html from this GetMapping
I tried like this
@GetMapping(value = "/{path:^.*(?!index.html)}")
but this is not working Do I need to write each API seperatly? Please Help me
Dot (.) is a special character to match any sign, you need to escape it with a backslash:
@GetMapping(value = "/{path:^(?!index\.html).*}")