DEV Community

Discussion on: How to host Angular app on Heroku

Collapse
 
umbe1987 profile image
umbe1987

Great, thanks! Just one small correction if I may: "res.sendFile(path.join(dirname + '/dist/dictionary/index.html'));" should probably be changed to something like "res.sendFile(path.join(dirname + '/dist//index.html'));".

Collapse
 
theowlsden profile image
Shaquil Maria

You can make it like this too:

app.get('/*', function (req, res) {
    res.sendFile('index.html', { root: 'dist/<project-name>/' }
    );
});
Enter fullscreen mode Exit fullscreen mode