Deploying an angular app to heroku from github subdirectory
1.Check Node and Npm version
2.Create Angular App
3.Run app(ng serve)
4.Add "heroku-postbuild": "ng build --prod" and "start": "node server.js" in scripts in package.json
5. Add "engines": { "node": "local machine version", "npm": "local machine version" } in package.json
6.Take devDependencies(@angular/cli,@angular/compiler-cli,typescript) to dependencies in package.json
7.install express server. npm install express path --save
8.Create server.js file in root directory and put this .
9. add "start": "node server.js" in scripts in in package.json
10.init git repo: (git remote add origin <new_repo_url> and commits and push )
11.login to heroko
12.create app
13.connect to GitHub repo
14.if necessary ,add buildpacks(https://github.com/timanovsky/subdir-heroku-buildpack) and nodejs and set PROJECT_PATH=Subdirectory folder name from setting
15.select branch to Deploy

Comments
Post a Comment