admin管理员组

文章数量:1192940

I'm having an issue serving a next js react app using springboot as a backend.

I have configured my nextjs app (app router) to build it in "export" output. (see screenshoot)

When I serve it statically in my springboot (/resources/static) it is served as a welcoming page by Spring: o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]

When browsing to / my front end is served correctly, when I browse into my website using the buttons and Links from nextjs I don't have any issues.

My problem arise when trying to put urls directly into the browser such as /account/login, im just getting 404s, if I add some controllers to redirect anything into my forward:/index.html It looks like my nextjs static app is not rooting by itself as its supposed to. non specific configuration

I tried everything I found on internet but nothing worked, any idea's?

本文标签: reactjsmapping issue with spring boot and next js react appStack Overflow