0

I am trying to run my Angular/Spring Boot app on AWS Beanstalk and I have been deploying it as a jar file. It runs successfully and works as expected, however whenever I refresh the application I get a whitelabel 404 error. I have tried both these approaches here and here and I still have not been able to resolve my issue. Executing this code block in my controller that implements ErrorController:

private static final String PATH = "/error";

    @RequestMapping(value = PATH)
    public String error(){
        return "forward:/index.html";
    }

    @Override
    public String getErrorPath() {
        return PATH;
    }

returns simply the string "forward:/index.html" in place of the whitelabel 404 error page

I have searched everywhere through all related topics and not been able to fix this so any help is greatly appreciated

  • What is the path on which you are refreshing? – Rafiek Jul 14 '20 at 19:50
  • @Rafiek I had fixed the issue by deploying the angular app as a static website on s3. I no longer get the error when refreshing – Steve Evrard Jul 17 '20 at 00:56
  • I was going to suggest this but first needed to get a better understanding of your problem. IMO, this architecture makes for a simpeler solution. Technically it's a bit more difficult because of CORS and authorization issues. – Rafiek Jul 17 '20 at 09:25
  • @Rafiek thanks for commenting. I agree, definitely poses some challenges but in the long run it is the best way to go about solving the issue – Steve Evrard Jul 21 '20 at 01:10

0 Answers0