{"id":428,"date":"2017-09-12T10:09:50","date_gmt":"2017-09-12T10:09:50","guid":{"rendered":"http:\/\/www.codeinsightacademy.com\/blog\/?p=428"},"modified":"2018-02-21T14:30:45","modified_gmt":"2018-02-21T14:30:45","slug":"angular-4-deployment","status":"publish","type":"post","link":"https:\/\/codeinsightacademy.com\/blog\/angular-js\/angular-4-deployment\/","title":{"rendered":"Angular 4 Deployment"},"content":{"rendered":"<p>Use any of the commands:<\/p>\n<ol>\n<li>ng build<\/li>\n<li>ng build &#8211;prod<\/li>\n<li>ng build &#8211;prod &#8211;base-href\u00a0\/directory-name\/sub-directory-name\/<\/li>\n<\/ol>\n<p>Create testing branch on github<\/p>\n<ol>\n<li>add normal git repository<\/li>\n<li>git branch gh-pages<\/li>\n<li>git push -u origin gh-pages<\/li>\n<\/ol>\n<p>To push on the git repository<\/p>\n<ol>\n<li>git init<\/li>\n<li>git add origin<\/li>\n<li>git add .<\/li>\n<li>git commit -m &#8220;Initial Commit&#8221;<\/li>\n<li>git push -u origin master<\/li>\n<li>ng build &#8211;prod &#8211;base-href https:\/\/whateveruser.github.io\/whateverprojectrepo\/<\/li>\n<li>ngh<\/li>\n<\/ol>\n<p>ng build &#8211;prod &#8211;base-href\u00a0https:\/\/github.com\/whateveruser\/whateverprojectrepo\/<\/p>\n<p>Ref:<\/p>\n<ol>\n<li>https:\/\/www.youtube.com\/watch?v=nxV3weqMzYo<\/li>\n<\/ol>\n<p>.htaccess\u00a0for production site<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">RewriteEngine on\r\n# Don't rewrite files or directories\r\nRewriteCond %{REQUEST_FILENAME} -f [OR]\r\nRewriteCond %{REQUEST_FILENAME} -d\r\nRewriteRule ^ - [L]\r\n\r\n# Rewrite everything else to index.html to allow html5 state links\r\nRewriteRule ^ index.html [L]\r\n<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Use any of the commands: ng build ng build &#8211;prod ng build &#8211;prod &#8211;base-href\u00a0\/directory-name\/sub-directory-name\/ Create testing branch on github add normal git repository git branch gh-pages git push -u origin gh-pages To push on the git repository git init git add origin git add . git commit -m &#8220;Initial Commit&#8221; git push -u origin master [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/428"}],"collection":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/comments?post=428"}],"version-history":[{"count":7,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/428\/revisions"}],"predecessor-version":[{"id":491,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/posts\/428\/revisions\/491"}],"wp:attachment":[{"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/media?parent=428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/categories?post=428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeinsightacademy.com\/blog\/wp-json\/wp\/v2\/tags?post=428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}