Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

How to upload Angular 2 Web Application to Hosting Server

I know Treehouse hasn't released it's Angular 2 course yet but I wondering if it can cover how to upload your finished Angular 2 website to a web host like GoDaddy or Bluehost. I see a lot of courses and tutorials out there that teach "How to build an Angular 2 Application" but they don't go into how to migrate your site from your local host to your web host.

In the meantime, if anyone has any suggestions, feel free to post them here.

3 Answers

Hi Veronica,

The ever-increasing complexity of client-side JavaScript frameworks makes it easy to forget that, at the end of the day, all the front-end code is rendered by a browser as HTML, CSS and vanilla JavaScript. Angular 2 is no different; you would still serve the compiled files from your chosen web host the same way as you were serving the files from localhost — i.e., JavaScript embedded in HTML.

jason chan
jason chan
31,009 Points

Example mean stack with angular 2

https://github.com/gangachris/ng2-mean

Then you push it up to heroku or whatever web hosting provider you choose. It has to be VPS

So exactly what do you upload to the server? Do you upload the root folder to the server? I still don't understand cause when I tried transferring a test project's root folder to our test server at work I get an error code 43 and it won't transfer all of the files. I have tried running a build and the app doesn't load and I get 404 errors in the console. I was using the angular cli to create the application and I have tried using the ng2-mean repo mentioned above.