package urchin;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class FrontendHandler {

    // Match everything without a suffix (so not a static resource)
    @RequestMapping(value = "/**/{[path:[^\\.]*}")
    public String redirect() {
        return "forward:/";
    }
}

handle frontend requests properly according to https://stackoverflow.com/questions/43913753/spring-boot-with-redirecting-with-single-page-angular2