Trying to deploy an Angular app to Heroku using Github, following the instructions on here: https://itnext.io/how-to-deploy-angular-application-to-heroku-1d56e09c5147
Deployment is successful, but when I open the app, I get a 'Not Found' error on the screen. Tried changing the location in 'app.use' and 'res.sendFile' a thousand times, but with no luck, for now this is my 'server.js' code:
These are my app.use and res.sendFile functions:
app.use(express.static(__dirname + '/dist/app_name'));
res.sendFile(path.join(__dirname + '/dist/app_name/index.html'));
Folder structure:
├── angular.json
├── browserslist
├── e2e
├── karma.conf.js
├── node_modules
├── package.json
├── package-lock.json
├── README.md
├── server.js
├── src
├── app
│ ├── assets
│ ├── environments
│ ├── favicon.ico
│ ├── index.html
│ ├── main.ts
│ ├── polyfills.ts
│ ├── styles.css
│ └── test.ts
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.spec.json
└── tslint.json
My guess would be that my deployment can't locate my index.html in the src folder, but I haven't got any more ideas what path to provide..
Tried removing the '_dirname' in both functions, but still the same problem.
Would highly appreciate all the suggestions.