Q:

Spring boot and Angular change path manually redirect to root

I am merging a Spring boot backend and an Angular frontend into one deployeable app. 
When I change the path manually like localhost/getCities/6 to localhost/getCites/12 or refresh the page, it redirects me to root localhost/. 
I tried to test it without backend and this way it works great. However when I build the frontend and put it to the backend I get this problem. 
I don't know what else I can try and what the problem could be?

A:

i solved this when add this to my controller in spring boot
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class ViewController {

@RequestMapping({"/getCities/**", "/streets/**"})
   public String index() {
       return "forward:/index.html";
   }
}

