{"id":24,"date":"2020-04-19T10:06:24","date_gmt":"2020-04-19T10:06:24","guid":{"rendered":"http:\/\/www.datatype.co.in\/blog\/?p=24"},"modified":"2020-08-20T09:27:40","modified_gmt":"2020-08-20T09:27:40","slug":"deploying-angular-app-in-production","status":"publish","type":"post","link":"https:\/\/datatype.co.in\/blog\/deploying-angular-app-in-production\/","title":{"rendered":"Deploying Angular App in Production"},"content":{"rendered":"\n<p> Once you are done with development of your angular project in your local machine, now it\u2019s time to build and deploy the same in production server. We can deploy angular build\/project in any http server. In this article, I will explain how to deploy angular app in xampp or wamp or lamp server.<\/p>\n\n\n\n<p><strong>1.<\/strong> <strong>Build the project: <\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>D:\\Projects\\first-angular-app> ng build first-angular-app -c production<\/code><\/pre>\n\n\n\n<p> This command will build the angular app and create a attributable package under&nbsp;<strong><em>dist\/ first-angular-app<\/em><\/strong>&nbsp;directory. Copy the first-angular-app directory and paste it in server www folder. <\/p>\n\n\n\n<p><strong>2. Modify base tag:<\/strong><\/p>\n\n\n\n<p> Open the index.html file and modify the base tag as shown below \u2013 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;base href=\"\/\">\nto\n&lt;base href=\".\/\"><\/code><\/pre>\n\n\n\n<p>That\u2019s all. Now open browser and run the app using the following url \u2013<\/p>\n\n\n\n<p><a href=\"http:\/\/localhost\/first-angular-app\/\">http:\/\/localhost\/first-angular-app\/<\/a><\/p>\n\n\n\n<p>You can replace localhost with production server dns if you are deploying the app in remote server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Once you are done with development of your angular project in your local machine, now it\u2019s time to build and deploy the same in production server. We can deploy angular&nbsp;[ &hellip; ]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[17,16],"class_list":["post-24","post","type-post","status-publish","format-standard","hentry","category-angular","tag-angular-app-deployment","tag-deploy-angular-app-in-production","list-style-post"],"_links":{"self":[{"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/posts\/24","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/comments?post=24"}],"version-history":[{"count":4,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/posts\/24\/revisions"}],"predecessor-version":[{"id":361,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/posts\/24\/revisions\/361"}],"wp:attachment":[{"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/media?parent=24"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/categories?post=24"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datatype.co.in\/blog\/wp-json\/wp\/v2\/tags?post=24"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}