Spring boot + Angular 6 + Heroku

Asked

Viewed 223 times

1

I created a web application where the front uses angular 6 and the back uses spring boot.

My goal at the moment is to put the application online.

On the local server when I run the spring boot the angular is called normally, when I put the application in Heroku only the links Rest work, when I try to access an angular route is shown me error.

Could someone help me?

Link generated by Heroku: https://sgm1.herokuapp.com/

Link to the city Rest: https://sgm1.herokuapp.com/cidade/listar

Link to the angular application: https://sgm1.herokuapp.com/login

Note: I’ve made the appropriate settings to integrate angular 6 with spring boot and for this reason it locally works perfectly.

1 answer

0


Maicon the configuration { useHash: true } is being enabled in the routes of your application.

Or is the url https://sgm1.herokuapp.com/login is being called as follows https://sgm1.herokuapp.com/#/login.

I don’t know if Heroku made this change automatically or not. But if you want to remove useHash you will need to redirect all other than the API for the index.html.

  • Hello Hiago. Thanks for the help. More to solve the problem I had to copy the angular build to the dist folder of Spring boot.

  • @Maiconthales that cool, but I point out that you create an answer with what you did to solve the problem and mark it as correct ;)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.