{"id":125,"date":"2019-03-02T09:56:36","date_gmt":"2019-03-02T09:56:36","guid":{"rendered":"http:\/\/doableyo.com\/yes\/?p=125"},"modified":"2019-05-07T15:09:43","modified_gmt":"2019-05-07T15:09:43","slug":"random-solution-to-development-issues-and-steps-to-getup-application-working","status":"publish","type":"post","link":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/","title":{"rendered":"how to solve basic development issues and steps to getup application working"},"content":{"rendered":"\n<p>These are the random solution to the issues, faced while developing the application in front-end and these are just the hand tools to fix issues and refer anytime in need. Hope it helps you in your search for solutions. Will keep updating with more and were need of improvement required to this page. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">ANGULAR &#8211; To use on CLI<\/h2>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>\/\/to run server with proxy file optionally can be set under angular.json &gt; server &gt; options &gt;<br>\nng serve &#8211;proxy-config proxy.config.json<\/p>\n\n\n\n<p>\/\/if need to add port optionally<br>\nng serve &#8211;proxy-config proxy.config.json &#8211;port 9999<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">EXPRESS &#8211; To use on CLI<\/h2>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>express &#8211;view=pug spar-api<\/p>\n\n\n\n<p>create : spar-api\\<br>\n   create : spar-api\\public\\<br>\n   create : spar-api\\public\\javascripts\\<br>\n    .<br>\n    .<\/p>\n\n\n\n<p>change directory:<br>\n     &gt; cd spar-api<\/p>\n\n\n\n<p>install dependencies:<br>\n     &gt; npm install<\/p>\n\n\n\n<p>run the app:<br>\n     &gt; SET DEBUG=spar-api:* &amp; npm start<\/p>\n\n\n\n<p>On Windows use this command<br>\n    set DEBUG=myapp:* &amp; npm start<\/p>\n\n\n\n<p>On Mac or linux<br>\n    DEBUG=myapp:* npm start<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>TO CREATE SECRECT KEY<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Window terminal side of code: <\/p>\n\n\n\n<p>node -e &#8220;console.log(require(&#8216;crypto&#8217;).randomBytes(256).toString(&#8216;base64&#8217;)); #not working with jwt token signing trying other way below: <\/p>\n\n\n\n<p>Source: https:\/\/gist.github.com\/Holger-Will\/3edeea6855f1d69a5368871bce5ea926 <\/p>\n\n\n\n<p>(tried on windows 7, working find with angular-jwt app)<\/p>\n\n\n\n<p>generate private key<\/p>\n\n\n\n<p>openssl genrsa -out private.pem 2048<\/p>\n\n\n\n<p>extatract public key from it<\/p>\n\n\n\n<p>openssl rsa -in private.pem -pubout &gt; public.pem<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Express side of code:<\/p>\n\n\n\n<p>\/\/Normalizing the path for windows environment<br>\nvar normalPKPath = path.normalize( __dirname + &#8216;\/private.key&#8217;);<\/p>\n\n\n\n<p>const RSA_PRIVATE_KEY = fs.readFileSync(normalPKPath, &#8216;utf8&#8217;);<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">FIREBASE SETUP FOR ANGULAR CLI PROJECT<\/h2>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Create project in firebase console web page; https:\/\/console.firebase.google.com\/<\/p>\n\n\n\n<p>install firebase tool<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>npm install -g firebase-tool<\/p><p>firebase login <\/p><\/blockquote>\n\n\n\n<p>Google will try to login with your google account <\/p>\n\n\n\n<p>(prior to init everytime, you have to make angular prod build ready and do firebase init each time for new deployment to firebase server)<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>firebase init <\/p><\/blockquote>\n\n\n\n<p>couple of questions will be asked after init command, type of deployment for web choose Hosting by presseing space bar key after selecting the option in list.<br>\nnext publish folder path to be, in angular cli its dist folder for production build, type dist and hit enter <br>\nnext it will ask you is your app is singple page app or not? type yes and hit enter<br>\nnext it will ask do you want to replace existing index.html with firebase choose now? because our prod build as created file under dist folder.<br>\nnext will create necessary files in your app directoy related to firebase\/<\/p>\n\n\n\n<p>make sure you update enviorments.prod.ts with firebase configuration detail, which you will get object from firebase console Create app for web page by clicking on it, <\/p>\n\n\n\n<p>under project overview page.<\/p>\n\n\n\n<p>next finially execute<\/p>\n\n\n\n<p>firebase deploy <\/p>\n\n\n\n<p>optionally you may use firebase deploy &#8211;proiect  <\/p>\n\n\n\n<p>if everything fine you will see app running under firebase server<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>ZEIT NOW &#8211; ISSUE SOLUTION<\/p>\n\n\n\n<hr class=\"wp-block-separator\"\/>\n\n\n\n<p>Build failing for typescript file: giving error Error: Cannot find module &#8216;typescript&#8217;<\/p>\n\n\n\n<p>Fix to use @now\/node@0.4.28-canary.6: in now.json file to make a build :<br>\nsolution source: Github Issue <a href=\"https:\/\/github.com\/zeit\/now-builders\/issues\/181\">https:\/\/github.com\/zeit\/now-builders\/issues\/181<\/a><\/p>\n\n\n\n<p>Example:     { &#8220;src&#8221;: &#8220;.\/src\/app\/server\/*.ts&#8221;, &#8220;use&#8221;: &#8220;@now\/node@0.4.28-canary.6&#8221;}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>These are the random solution to the issues, faced while developing the application in front-end and these are just the hand tools to fix issues and refer anytime in need. Hope it helps you in your search for solutions. Will keep updating with more and were need of improvement required to this page. ANGULAR &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,14],"tags":[],"class_list":["post-125","post","type-post","status-publish","format-standard","hentry","category-blog","category-tech","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>how to solve basic development issues and steps to getup application working - DoableYo!<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"how to solve basic development issues and steps to getup application working - DoableYo!\" \/>\n<meta property=\"og:description\" content=\"These are the random solution to the issues, faced while developing the application in front-end and these are just the hand tools to fix issues and refer anytime in need. Hope it helps you in your search for solutions. Will keep updating with more and were need of improvement required to this page. ANGULAR &#8211; [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/\" \/>\n<meta property=\"og:site_name\" content=\"DoableYo!\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-02T09:56:36+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-05-07T15:09:43+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/#article\",\"isPartOf\":{\"@id\":\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/doableyo.com\/yes\/#\/schema\/person\/0b9be73850e0b7b2bda8b903e2ea07c3\"},\"headline\":\"how to solve basic development issues and steps to getup application working\",\"datePublished\":\"2019-03-02T09:56:36+00:00\",\"dateModified\":\"2019-05-07T15:09:43+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/\"},\"wordCount\":533,\"articleSection\":[\"Blog\",\"Tech\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/\",\"url\":\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/\",\"name\":\"how to solve basic development issues and steps to getup application working - DoableYo!\",\"isPartOf\":{\"@id\":\"https:\/\/doableyo.com\/yes\/#website\"},\"datePublished\":\"2019-03-02T09:56:36+00:00\",\"dateModified\":\"2019-05-07T15:09:43+00:00\",\"author\":{\"@id\":\"https:\/\/doableyo.com\/yes\/#\/schema\/person\/0b9be73850e0b7b2bda8b903e2ea07c3\"},\"breadcrumb\":{\"@id\":\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/doableyo.com\/yes\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"how to solve basic development issues and steps to getup application working\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/doableyo.com\/yes\/#website\",\"url\":\"https:\/\/doableyo.com\/yes\/\",\"name\":\"DoableYo!\",\"description\":\"Yo is the boost behind it!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/doableyo.com\/yes\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/doableyo.com\/yes\/#\/schema\/person\/0b9be73850e0b7b2bda8b903e2ea07c3\",\"name\":\"admin\",\"url\":\"http:\/\/doableyo.com\/yes\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"how to solve basic development issues and steps to getup application working - DoableYo!","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/","og_locale":"en_US","og_type":"article","og_title":"how to solve basic development issues and steps to getup application working - DoableYo!","og_description":"These are the random solution to the issues, faced while developing the application in front-end and these are just the hand tools to fix issues and refer anytime in need. Hope it helps you in your search for solutions. Will keep updating with more and were need of improvement required to this page. ANGULAR &#8211; [&hellip;]","og_url":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/","og_site_name":"DoableYo!","article_published_time":"2019-03-02T09:56:36+00:00","article_modified_time":"2019-05-07T15:09:43+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/#article","isPartOf":{"@id":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/"},"author":{"name":"admin","@id":"https:\/\/doableyo.com\/yes\/#\/schema\/person\/0b9be73850e0b7b2bda8b903e2ea07c3"},"headline":"how to solve basic development issues and steps to getup application working","datePublished":"2019-03-02T09:56:36+00:00","dateModified":"2019-05-07T15:09:43+00:00","mainEntityOfPage":{"@id":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/"},"wordCount":533,"articleSection":["Blog","Tech"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/","url":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/","name":"how to solve basic development issues and steps to getup application working - DoableYo!","isPartOf":{"@id":"https:\/\/doableyo.com\/yes\/#website"},"datePublished":"2019-03-02T09:56:36+00:00","dateModified":"2019-05-07T15:09:43+00:00","author":{"@id":"https:\/\/doableyo.com\/yes\/#\/schema\/person\/0b9be73850e0b7b2bda8b903e2ea07c3"},"breadcrumb":{"@id":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/doableyo.com\/yes\/random-solution-to-development-issues-and-steps-to-getup-application-working\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/doableyo.com\/yes\/"},{"@type":"ListItem","position":2,"name":"how to solve basic development issues and steps to getup application working"}]},{"@type":"WebSite","@id":"https:\/\/doableyo.com\/yes\/#website","url":"https:\/\/doableyo.com\/yes\/","name":"DoableYo!","description":"Yo is the boost behind it!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/doableyo.com\/yes\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/doableyo.com\/yes\/#\/schema\/person\/0b9be73850e0b7b2bda8b903e2ea07c3","name":"admin","url":"http:\/\/doableyo.com\/yes\/author\/admin\/"}]}},"_links":{"self":[{"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/posts\/125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/comments?post=125"}],"version-history":[{"count":3,"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/posts\/125\/revisions"}],"predecessor-version":[{"id":181,"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/posts\/125\/revisions\/181"}],"wp:attachment":[{"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/media?parent=125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/categories?post=125"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/doableyo.com\/yes\/wp-json\/wp\/v2\/tags?post=125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}