I am having trouble finding a tutorial on how to host an angular2 application (hopefully with Typescript) on Heroku or any other hosting provider for that matter.
Ideally, I'd like to find a way to run this repo on Heroku but guidance on any angular2/typescript repo on Heroku would be helpful: https://github.com/auth0/angular2-authentication-sample
Any guidance or advise you can offer would be greatly appreciated
For that question, you should answer “yes” to enable Angular routing. After the CLI completes its process, you will have a fully operating Angular application. You can test it out by stepping into the project directory cd angular-app-in-heroku and then running ng serve .
You will need server app/framework for that.
This repository contains files from Express generator app and Quick-start Angular 2 app.
I have one other example that is also ready for Heroku: express + angular 2 + Procfile ( needed by the Heroku ) + other libraries
You need an account on Heroku. Push this code as-is ( in both cases ).
Official repo from Angular2 ( server side rendering ) on Express: https://github.com/angular/universal-starter
If you use Heroku's Node buildpack, I believe you should be fine. I was able to deploy the Angular 2 seed project to Heroku this way.
If you want to deploy a real, full-blown web application using Angular 2, you will almost certainly need some sort of persistence layer, like Vlado mentioned.
If you're interested in deploying Angular 2 to Heroku with Rails, here's a tutorial for that. https://www.angularonrails.com/deploy-angular-2rails-5-app-heroku/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With