Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying angular2 project on go daddy server

I have an angular-2 project running on my local host. I want to deploy it to GoDaddy server. I can't install node, npm on GoDaddy server. So my question is how can I run my angular-2 project on GoDaddy server. Thanks

like image 924
National News Avatar asked Jan 28 '17 07:01

National News


People also ask

How do I deploy a project on GoDaddy?

Step 1: Login to your GoDaddy account, click on Hosting, and select Manage Account to go to the control panel. Step 2: Click “Content” and select “FTP Client”. Step 3: Upload your web application folder by selecting the application folder on your Local System and clicking “>>” to upload to the root folder.

Can I host angular website on GoDaddy?

2. Go to your project/dist Copy your Build Project which is automatically created and paste it to desktop -> Right Click on that pasted project folder -> Add to zip . 3. Go to your godaddy account -> profile -> my Products ->Starter Linux Hosting with cPanel ->manage ->cpanel Admin -> file manager .

Can angular run on shared hosting?

You have to command ng build --prod . This will build your app into the dist folder. Copy the contents of your dist folder to the public directory of your shared hosting. Works great, if Angular 2 CLI was used, otherwise it returns You have to be inside an angular-cli project in order to use the build command. .

How can I host angular website for free?

You just need a github repository to host on github and make sure that you pushed the latest code. Install github pages tool for angular by using, npm install -g angular-cli-ghpages . Here deploying code in github pages is quite easy, Just need to make sure one thing, when you build your code, use --base-href tag.


4 Answers

Install Angular CLI if you don't have it already.

npm install -g angular-cli

Then build using the command -

ng build

This will create a /dist directory with the production build of your application. Just copy the contents of /dist to your hosting provider (using FTP, SCP etc.).

Refer - https://github.com/angular/angular-cli

like image 59
manojtc Avatar answered Oct 18 '22 18:10

manojtc


1.If your project is completed then build your project using

ng build --prod

2.Go to your project/dist Copy your Build Project which is automatically created and paste it to desktop -> Right Click on that pasted project folder -> Add to zip .

3.Go to your godaddy account -> profile -> my Products ->Starter Linux Hosting with cPanel ->manage ->cpanel Admin -> file manager .

  1. Click on public_html folder .

  2. click on Upload -> select file -> select your Zip folder -> click on link "Go Back to "home/frurugf45/public_html" .

And your Angular file uploaded on go godaddy server

like image 21
Anand raj Avatar answered Oct 18 '22 19:10

Anand raj


Run ng build --prod don't forget to use --prod. It means build the application in Production mode. It's performance of application is faster than ng build.

like image 6
Geetanshu Gulati Avatar answered Oct 18 '22 18:10

Geetanshu Gulati


Use $ ng build --prod if your application is ready for production. It will reduce the size and increase speed of your application on the web.

$ ng build VS. $ ng build --prod
My small application went from 23mb to 2mb.


Loading time on 3G network: 8 seconds FAIR, 28% visitor loss due to loading time
VS.
Loading time on 3G network: 4 seconds GOOD, 10% visitor loss due to loading time

enter image description here

VS. enter image description here

like image 2
tborges Avatar answered Oct 18 '22 20:10

tborges