{"id":1179,"date":"2021-05-28T14:20:34","date_gmt":"2021-05-28T12:20:34","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=1179"},"modified":"2022-06-08T17:55:06","modified_gmt":"2022-06-08T15:55:06","slug":"setting-paramaters-for-ng-serve-in-config-file","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2021\/05\/28\/setting-paramaters-for-ng-serve-in-config-file\/","title":{"rendered":"How to set default paramaters for &#8220;ng serve&#8221; in config file?"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>instead of typing : <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ng serve --host example.com --port 4205<\/code><\/pre>\n\n\n\n<p>We just want to type <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\n\nng serve<\/code><\/pre>\n\n\n\n<p> <\/p>\n\n\n\n<h4>Angular CLI 6+<\/h4>\n\n\n\n<h2><br>Angular CLI 6+<\/h2>\n\n\n\n<p>In the latest version of Angular, we can set this in&nbsp;<a href=\"https:\/\/angular.io\/guide\/workspace-config\">the&nbsp;<code>angular.json<\/code>&nbsp;config file<\/a>.&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"$schema\": \".\/node_modules\/@angular\/cli\/lib\/config\/schema.json\",\n    \"projects\": {\n        \"my-project\": {\n            \"architect\": {\n                \"serve\": {\n                    \"options\": {\n                        \"port\": 4205,\n                        \"host\": \"example.com\"\n                    }\n                }\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p>We &nbsp;can also use&nbsp;<a href=\"https:\/\/angular.io\/cli\/config\"><code>ng config<\/code><\/a>&nbsp;to view\/edit values:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ng config projects&#91;\"my-project\"].architect&#91;\"serve\"].options {port:4444}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>instead of typing : We just want to type Angular CLI 6+ Angular CLI 6+ In the latest version of Angular, we can set this in&nbsp;the&nbsp;angular.json&nbsp;config file.&nbsp; We &nbsp;can also use&nbsp;ng config&nbsp;to view\/edit values:<\/p>\n","protected":false},"author":1,"featured_media":1965,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1,37],"tags":[323,188,324,161],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1179"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1179"}],"version-history":[{"count":4,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1179\/revisions"}],"predecessor-version":[{"id":1969,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1179\/revisions\/1969"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/1965"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1179"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1179"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1179"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}