{"id":4825,"date":"2017-04-27T18:11:42","date_gmt":"2017-04-27T18:11:42","guid":{"rendered":"http:\/\/putridparrot.com\/blog\/?p=4825"},"modified":"2023-12-05T15:42:34","modified_gmt":"2023-12-05T15:42:34","slug":"cannot-get-in-angular","status":"publish","type":"post","link":"https:\/\/putridparrot.com\/blog\/cannot-get-in-angular\/","title":{"rendered":"Cannot GET \/ in Angular"},"content":{"rendered":"<p>I was playing with the quick start tutorial from Angular&#8217;s <a href=\"https:\/\/angular.io\/docs\/ts\/latest\/guide\/setup.html\" target=\"_blank\" rel=\"noopener\">setup page<\/a> on their web site. <\/p>\n<p>Using the file\/folder layout on their <a href=\"https:\/\/angular.io\/docs\/ts\/latest\/tutorial\/toh-pt1.html\" target=\"_blank\" rel=\"noopener\">THE HERO EDITOR<\/a> I removed all folders\/files not listed in their diagram. <\/p>\n<p>For completeness I&#8217;ll duplicate the information here<\/p>\n<p>angular-tour-of-heroes<br \/>\n|&#8212;src<br \/>\n|&#8212;|&#8212;app<br \/>\n|&#8212;|&#8212;|&#8212;app.component.ts<br \/>\n|&#8212;|&#8212;|&#8212;app.module.ts<br \/>\n|&#8212;|&#8212;index.html<br \/>\n|&#8212;|&#8212;main.ts<br \/>\n|&#8212;|&#8212;styles.css<br \/>\n|&#8212;|&#8212;systemjs.config.js<br \/>\n|&#8212;|&#8212;tsconfig.json<br \/>\n|&#8212;node_modules &#8230;<br \/>\n|&#8212;package.json<\/p>\n<p>I then ran <em>npm start<\/em> from the command prompt in the root angular-tour-of-heroes and up pops the browser with <strong>Cannot GET \/<\/strong>, looking at the output from npm I could see index.html was not found by npm.<\/p>\n<p>I also noticed npm couldn&#8217;t find a file bs-config.json, so I located that from the quick start and placed it in the root angular-tour-of-heroes folder and all worked correctly, no more 404.<\/p>\n<p>Here&#8217;s why, the bs-confog.json gives the baseDir of the &#8220;website&#8221;, here&#8217;s the file context<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\n{\r\n  &quot;server&quot;: {\r\n    &quot;baseDir&quot;: &quot;src&quot;,\r\n    &quot;routes&quot;: {\r\n      &quot;\/node_modules&quot;: &quot;node_modules&quot;\r\n    }\r\n  }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I was playing with the quick start tutorial from Angular&#8217;s setup page on their web site. Using the file\/folder layout on their THE HERO EDITOR I removed all folders\/files not listed in their diagram. For completeness I&#8217;ll duplicate the information here angular-tour-of-heroes |&#8212;src |&#8212;|&#8212;app |&#8212;|&#8212;|&#8212;app.component.ts |&#8212;|&#8212;|&#8212;app.module.ts |&#8212;|&#8212;index.html |&#8212;|&#8212;main.ts |&#8212;|&#8212;styles.css |&#8212;|&#8212;systemjs.config.js |&#8212;|&#8212;tsconfig.json |&#8212;node_modules &#8230; |&#8212;package.json I [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[170,169],"tags":[],"class_list":["post-4825","post","type-post","status-publish","format-standard","hentry","category-angular","category-node-js"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/4825","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/comments?post=4825"}],"version-history":[{"count":5,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/4825\/revisions"}],"predecessor-version":[{"id":10278,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/posts\/4825\/revisions\/10278"}],"wp:attachment":[{"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/media?parent=4825"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/categories?post=4825"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/putridparrot.com\/blog\/wp-json\/wp\/v2\/tags?post=4825"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}