I have an angular2 application in heroku and am having problems with the router. In the local host everything works like a charm, but when I deploy to the hero and try to access on any route that is not an index, I got a 404 error if I go along the index and then go to the pass page, routing works fine if I if I donβt reload the page, then I get another 404, here is a piece of my .json package used by the hero. "heroku-prebuild": "npm install http-server -g", "heroku-postbuild": "ng build --target=production --environment=prod && rsync -a dist/* .", "start": "http-server dist/", Do I need to configure any express account that will be used in my Procfile?
"heroku-prebuild": "npm install http-server -g", "heroku-postbuild": "ng build --target=production --environment=prod && rsync -a dist/* .", "start": "http-server dist/",
, , angular , . index.html. ,
app.get('*', function (req, res) { res.sendfile('./dist/index.html'); // load our index.html file });
404, . i.e index.html angular , .
Source: https://habr.com/ru/post/1660211/More articles:How to customize labels on both halves of a semi-load chart? - d3.jsWhy std :: numeric_limits :: max () doesn't work? - c ++How to code a polymorphic model of Binder and provider in MVC 6 - polymorphismWhy all identifiers will not be changed, although I selected all of them using # idname? - javascriptAndroid AAR library import - no class definition - javaYoutube Popup Closing - jqueryLARAVEL HOMESTEAD SQLSTATE [HY000] [1862] Your password has expired. To log in, you must change it using a client that supports expired passwords - phpThe CausalImpact package in R does not work for the bsts - rUploading an image to amazon s3 using multer-s3 nodejs - node.jsHow to return correct timezone in PHP - timezoneAll Articles