<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	Comments on: How to use PostgreSQL in Nodejs	</title>
	<atom:link href="https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/</link>
	<description>AI, Salesforce, ServiceNow &#38; Enterprise Tech Guides</description>
	<lastBuildDate>Mon, 18 May 2020 21:04:07 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>
		By: Ayan Pramanik		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-6127</link>

		<dc:creator><![CDATA[Ayan Pramanik]]></dc:creator>
		<pubDate>Mon, 18 May 2020 21:04:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-6127</guid>

					<description><![CDATA[when I click on the button &#039;Add&#039; nothing is happening. On reload the page an error is thrown:

An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command

Following is the error log

2020-05-18T20:43:04.724323+00:00 app[web.1]:
2020-05-18T20:43:04.724420+00:00 app[web.1]: events.js:72
2020-05-18T20:43:04.724667+00:00 app[web.1]: throw er; // Unhandled &#039;error&#039; event
2020-05-18T20:43:04.724691+00:00 app[web.1]: ^
2020-05-18T20:43:04.725969+00:00 app[web.1]: Error: connect ECONNREFUSED
2020-05-18T20:43:04.725970+00:00 app[web.1]: at errnoException (net.js:905:11)
2020-05-18T20:43:04.725972+00:00 app[web.1]: at Object.afterConnect [as oncomplete] (net.js:896:19)]]></description>
			<content:encoded><![CDATA[<p>when I click on the button &#8216;Add&#8217; nothing is happening. On reload the page an error is thrown:</p>
<p>An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command</p>
<p>Following is the error log</p>
<p>2020-05-18T20:43:04.724323+00:00 app[web.1]:<br />
2020-05-18T20:43:04.724420+00:00 app[web.1]: events.js:72<br />
2020-05-18T20:43:04.724667+00:00 app[web.1]: throw er; // Unhandled &#8216;error&#8217; event<br />
2020-05-18T20:43:04.724691+00:00 app[web.1]: ^<br />
2020-05-18T20:43:04.725969+00:00 app[web.1]: Error: connect ECONNREFUSED<br />
2020-05-18T20:43:04.725970+00:00 app[web.1]: at errnoException (net.js:905:11)<br />
2020-05-18T20:43:04.725972+00:00 app[web.1]: at Object.afterConnect [as oncomplete] (net.js:896:19)</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Yatish Patil		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-5436</link>

		<dc:creator><![CDATA[Yatish Patil]]></dc:creator>
		<pubDate>Tue, 10 Sep 2019 07:45:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-5436</guid>

					<description><![CDATA[Why we are using angular JS here ? Any alternative for that?]]></description>
			<content:encoded><![CDATA[<p>Why we are using angular JS here ? Any alternative for that?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Suresh		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-4371</link>

		<dc:creator><![CDATA[Suresh]]></dc:creator>
		<pubDate>Mon, 07 May 2018 00:48:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-4371</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2463&quot;&gt;Jitendra Zaa&lt;/a&gt;.

Hello Jitendra,

Thanks for this wonderful article. I&#039;m new to Node/expressJS.
When try i to access external website (salesforce Marketing cloud) using index.html and App.js i&#039;m not able to 
1) pass the http request from index.html to App.js 2) hence i have http request code in App.js. 3) i&#039;m able to get the response from SFMC but not able to pass the same to index.html to parse and display.

Index.html code:
$scope.getAllRec = function(){ 
   $http ({
      method: &#039;GET&#039;,
      url: &#039;/hub/v1/campaigns&#039;,
      //url: &#039;https://www.exacttargetapis.com/hub/v1/campaigns&#039;,
      headers: { &#039;Authorization&#039;: &#039;Bearer &#039;abc&#039;, &#039;content-type&#039;: &#039;application/json&#039; }					
   }). success(function(data, status) 
      {   console.log (&#039;success: str form for JSON: &#039; + data);
	  alert(&#039;AngularJS success scope: &#039;);
          $scope.dataset = JSON.parse(data); 
	  alert($scope.dataset);
      }). error(function(data, status) 
         {   console.log (&#039;error: str form for JSON: &#039; + data);
	     alert(&#039;AngularJS error scope: &#039;);
             $scope.dataset = data &#124;&#124; &quot;Request failed &quot;; 
             alert($scope.dataset);
          }); //end of error fun
} //end of function

App.js code:
app.get(&#039;/hub/v1/campaigns&#039;, function(req, res) 
{
   request ({
	            uri: &#039;https://www.exacttargetapis.com/hub/v1/campaigns&#039;,
	            headers: { &#039;Authorization&#039;: &#039;Bearer 7AN0d9ntuWA9tYSHvbziJG6Q&#039;,	&#039;content-type&#039;: &#039;application/json&#039;}
		 },
		 function(error, response, body) 
                 {
		    if (!error &#038;&#038; res.statusCode === 200) 
                    {							
				res.writeHead(200, {&#039;Content-Type&#039;: &#039;text/plain&#039;});
				res.write(JSON.stringify( body, null, &quot; &quot;));				
				console.log(body);				
				res.sendfile(&#039;views/index.html&#039;);
				res.end();
				
		     }
		     else 
                     { 
                        res.json (error);
		     }
			
		    console.log(&#039;Original URL is: &#039;+ req.originalUrl); // &#039;/admin/new&#039;
		    console.log(&#039;Base URL is: &#039;, req.baseUrl); // &#039;/admin&#039;
		    console.log(&#039;Path is: &#039; + 	req.path);
	
		});	
	
	//function replacer(key, value) {
	//	return key.replaceAll(/\\/g,&#039;&#039;);
	//} 
    
} );

May be an example of how to access external site and pass the json response to html/view will help a lot get going.

Regards,
Suresh]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2463">Jitendra Zaa</a>.</p>
<p>Hello Jitendra,</p>
<p>Thanks for this wonderful article. I&#8217;m new to Node/expressJS.<br />
When try i to access external website (salesforce Marketing cloud) using index.html and App.js i&#8217;m not able to<br />
1) pass the http request from index.html to App.js 2) hence i have http request code in App.js. 3) i&#8217;m able to get the response from SFMC but not able to pass the same to index.html to parse and display.</p>
<p>Index.html code:<br />
$scope.getAllRec = function(){<br />
   $http ({<br />
      method: &#8216;GET&#8217;,<br />
      url: &#8216;/hub/v1/campaigns&#8217;,<br />
      //url: &#8216;https://www.exacttargetapis.com/hub/v1/campaigns&#8217;,<br />
      headers: { &#8216;Authorization&#8217;: &#8216;Bearer &#8216;abc&#8217;, &#8216;content-type&#8217;: &#8216;application/json&#8217; }<br />
   }). success(function(data, status)<br />
      {   console.log (&#8216;success: str form for JSON: &#8216; + data);<br />
	  alert(&#8216;AngularJS success scope: &#8216;);<br />
          $scope.dataset = JSON.parse(data);<br />
	  alert($scope.dataset);<br />
      }). error(function(data, status)<br />
         {   console.log (&#8216;error: str form for JSON: &#8216; + data);<br />
	     alert(&#8216;AngularJS error scope: &#8216;);<br />
             $scope.dataset = data || &#8220;Request failed &#8220;;<br />
             alert($scope.dataset);<br />
          }); //end of error fun<br />
} //end of function</p>
<p>App.js code:<br />
app.get(&#8216;/hub/v1/campaigns&#8217;, function(req, res)<br />
{<br />
   request ({<br />
	            uri: &#8216;https://www.exacttargetapis.com/hub/v1/campaigns&#8217;,<br />
	            headers: { &#8216;Authorization&#8217;: &#8216;Bearer 7AN0d9ntuWA9tYSHvbziJG6Q&#8217;,	&#8216;content-type&#8217;: &#8216;application/json&#8217;}<br />
		 },<br />
		 function(error, response, body)<br />
                 {<br />
		    if (!error &amp;&amp; res.statusCode === 200)<br />
                    {<br />
				res.writeHead(200, {&#8216;Content-Type&#8217;: &#8216;text/plain&#8217;});<br />
				res.write(JSON.stringify( body, null, &#8221; &#8220;));<br />
				console.log(body);<br />
				res.sendfile(&#8216;views/index.html&#8217;);<br />
				res.end();</p>
<p>		     }<br />
		     else<br />
                     {<br />
                        res.json (error);<br />
		     }</p>
<p>		    console.log(&#8216;Original URL is: &#8216;+ req.originalUrl); // &#8216;/admin/new&#8217;<br />
		    console.log(&#8216;Base URL is: &#8216;, req.baseUrl); // &#8216;/admin&#8217;<br />
		    console.log(&#8216;Path is: &#8216; + 	req.path);</p>
<p>		});	</p>
<p>	//function replacer(key, value) {<br />
	//	return key.replaceAll(/\\/g,&#8221;);<br />
	//} </p>
<p>} );</p>
<p>May be an example of how to access external site and pass the json response to html/view will help a lot get going.</p>
<p>Regards,<br />
Suresh</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Emre		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2907</link>

		<dc:creator><![CDATA[Emre]]></dc:creator>
		<pubDate>Wed, 06 Jan 2016 10:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-2907</guid>

					<description><![CDATA[Hi

Thanks for this great article.  But,  i could not run the passing datas from the html page to database. I test  dbOperations with url get requests and it works properly. But, html apge does not call dbOperations. Do you have any suggestions? Should i change sometings in &#039;index.html&#039;?



Thanks again.]]></description>
			<content:encoded><![CDATA[<p>Hi</p>
<p>Thanks for this great article.  But,  i could not run the passing datas from the html page to database. I test  dbOperations with url get requests and it works properly. But, html apge does not call dbOperations. Do you have any suggestions? Should i change sometings in &#8216;index.html&#8217;?</p>
<p>Thanks again.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: guest		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2586</link>

		<dc:creator><![CDATA[guest]]></dc:creator>
		<pubDate>Sun, 28 Jun 2015 00:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-2586</guid>

					<description><![CDATA[You can save lots of time with pg-promise: https://github.com/vitaly-t/pg-promise]]></description>
			<content:encoded><![CDATA[<p>You can save lots of time with pg-promise: <a href="https://github.com/vitaly-t/pg-promise" rel="nofollow ugc">https://github.com/vitaly-t/pg-promise</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jitendra Zaa		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2535</link>

		<dc:creator><![CDATA[Jitendra Zaa]]></dc:creator>
		<pubDate>Fri, 05 Jun 2015 04:42:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-2535</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2534&quot;&gt;Thomas Q Brady&lt;/a&gt;.

Yeah, I installed manually, we need it in Package.json.

https://github.com/JitendraZaa/node-postgres/tree/master/node_modules]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2534">Thomas Q Brady</a>.</p>
<p>Yeah, I installed manually, we need it in Package.json.</p>
<p><a href="https://github.com/JitendraZaa/node-postgres/tree/master/node_modules" rel="nofollow ugc">https://github.com/JitendraZaa/node-postgres/tree/master/node_modules</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Thomas Q Brady		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2534</link>

		<dc:creator><![CDATA[Thomas Q Brady]]></dc:creator>
		<pubDate>Fri, 05 Jun 2015 02:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-2534</guid>

					<description><![CDATA[Shouldn&#039;t the &#039;pg&#039; module be in your package.json?]]></description>
			<content:encoded><![CDATA[<p>Shouldn&#8217;t the &#8216;pg&#8217; module be in your package.json?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sohit		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2464</link>

		<dc:creator><![CDATA[sohit]]></dc:creator>
		<pubDate>Wed, 22 Apr 2015 07:01:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-2464</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2463&quot;&gt;Jitendra Zaa&lt;/a&gt;.

After series of test, I was able to actually find out the issue. I changed the port number and also I found out that in code I used var dbOperations which is case sensitive. but after changing the file name to which I was using, I was finally able to run the app at server. Thank so much for the excellent post to get introduced to node Js]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2463">Jitendra Zaa</a>.</p>
<p>After series of test, I was able to actually find out the issue. I changed the port number and also I found out that in code I used var dbOperations which is case sensitive. but after changing the file name to which I was using, I was finally able to run the app at server. Thank so much for the excellent post to get introduced to node Js</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Jitendra Zaa		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2463</link>

		<dc:creator><![CDATA[Jitendra Zaa]]></dc:creator>
		<pubDate>Mon, 20 Apr 2015 14:32:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-2463</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2460&quot;&gt;sohit&lt;/a&gt;.

Hi Sohit,
Did you tried to fetch heroku log for errors ? What error you are getting ?]]></description>
			<content:encoded><![CDATA[<p>In reply to <a href="https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2460">sohit</a>.</p>
<p>Hi Sohit,<br />
Did you tried to fetch heroku log for errors ? What error you are getting ?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: sohit		</title>
		<link>https://www.jitendrazaa.com/blog/webtech/how-to-use-postgresql-in-nodejs/#comment-2462</link>

		<dc:creator><![CDATA[sohit]]></dc:creator>
		<pubDate>Mon, 20 Apr 2015 11:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.jitendrazaa.com/blog/?p=4047#comment-2462</guid>

					<description><![CDATA[After making some  changes like changing port number I was able to run the app locally correctly : but now after deploying to Heroku i get error as ;

Error: Cannot find module &#039;./dbOperations.js&#039;



I have removed .js extension still getting the same error. Please help how to solve this error.]]></description>
			<content:encoded><![CDATA[<p>After making some  changes like changing port number I was able to run the app locally correctly : but now after deploying to Heroku i get error as ;</p>
<p>Error: Cannot find module &#8216;./dbOperations.js&#8217;</p>
<p>I have removed .js extension still getting the same error. Please help how to solve this error.</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: www.jitendrazaa.com @ 2026-05-25 22:33:16 by W3 Total Cache
-->