Reputation: 668
I'm learning Angular 2 - I just finished the official Tour Of Heroes tutorial (https://angular.io/docs/ts/latest/tutorial/) and built my own website with weather just for training.
The whole application from the tutorial was built using NodeJS, which, as I understand it, is used to run javascript files. But, what if I want to upload my website to a server (one of the free hostings) to see how it looks like on my other devices (mobile, tablet, etc.)?
Without angular, I wouldn't have problems with that - I'd just use FTP client to upload my .html, .css and .js files to the hosting. But how should I do it with angular2 application? In my project's directory there are folders like: node_modules, typings - they contain a lot of files, and I'm not sure if they are needed. I know that browsers do not support TypeScript (which I'm using), so I should only upload .js files, but how exactly should it be? Which files should I upload?
I tried uploading everything but node_modules and typings folders, but I just got "Loading..." when I tried accessing the website.
I saw this: Hosting Angular 2 app and there people just said to upload every js file, which I did.
Here's the link to my website: http://myweatherapp.comxa.com
//EDIT All the above can be represented by this one question: What are the steps to transform local angular2-quick-start-app into a website, which can be uploaded to any web-hosting?
Upvotes: 2
Views: 153
Reputation: 3423
Take a look at Angular-Cli.
They make it so easy to build/bundle Angular 2 apps. They include a ng build
and ng build:prod
commands to build the angular 2 project into a distribution folder, standalone web app, so you can put it in a tomcat instance or anywhere and not just in a NodeJS environment.
Angular-Cli provides everything one could want when building an Angular 2 app. Take a look at their Table of Contents. The Build section is probably what you are more interested in
I use Angular-Cli and I absolutely love it.
Upvotes: 1