Completed

Help with NodeJS and PostgreSQL. Send JSON data from NodeJS to Browser.

I will pay only for helping and not doing it for me.

You tell me what to do and I'm doing it.

I have a NodeJS server that uses PostgreSQL as a database.

I'm able to connect to the database and get data from it using NodeJS but I failed to send the data from NodeJS back to the client(frontend).

[login to view URL](nodejs)

const router = (req, res) => {

[login to view URL]([login to view URL]);

let result = [login to view URL]("SELECT * FROM members");

[login to view URL](result);

}

[login to view URL](nodejs)

const {Client} = require('pg');

const connData = { ... };

[login to view URL] = {

async select( sql ){

const db = new Client(connData);

try{

await [login to view URL]();

[login to view URL]("Connected to DB");

const result = await [login to view URL]( sql );

[login to view URL]([login to view URL]); // <--- Shows the data in the NodeJS console.

let str = [login to view URL]([login to view URL]);

return str;

}

catch(ex){

[login to view URL]("We messed up! " + ex);

}

finally{

await [login to view URL]();

[login to view URL]("DB connection closed");

}

}

};

[login to view URL](frontend)

"use strict";

var btn = [login to view URL]('button');

function ajax(){

let req = new XMLHttpRequest();

[login to view URL] = function(){

if( [login to view URL] === 4 && [login to view URL] === 200){

let data = [login to view URL]( [login to view URL] );

[login to view URL](data);

}

};

[login to view URL]("GET", "/ajax/", true);

[login to view URL]();

};

[login to view URL]("click", (e)=>{

[login to view URL]();

ajax();

});

The console in my browser returns a empty string.

Skills: Javascript, JSON, node.js, PostgreSQL

See more: auto send post data, send purchase data paypal, send access data tables excel, j2me web services send receive data, adding json data jquery select box, send form data mysql database using php, firefox addon send post data url, send form data csv file asp, curl send post data, php send form data fsockopen, send character data graphics lcd, firefox send post data, send post data php login, send post data url firefox, send load data mysql flash, send gprs data web, send post data php, arduino send rs232 data string

About the Employer:
( 0 reviews ) Hamburg, Germany

Project ID: #19943245

Awarded to:

sayansaha986

Hi, I can help you to develop a Nodejs app to send data from db to browser. let's have a chat to discuss further on this project. thanks, Sayan

€8 EUR / hour
(15 Reviews)
3.5

10 freelancers are bidding on average €13/hour for this job

mak94pk

Hello Sir/Mam, MAKSOF is a team of highly qualified professionals who is dedicated in providing creative solutions and innovative ideas for your business with our skills in technologies and strategies. We have r More

€10 EUR / hour
(55 Reviews)
6.8
digitalaptech

Hello, As per your tech-skills, I am sharing you the resume of one of our Full Stack Developer, please have a look. [login to view URL] We are rea More

€10 EUR / hour
(11 Reviews)
6.1
armsofter

Hello, I am full stack web developer with 7 years of experience. Mostly I am working with MEAN (mongodb, [login to view URL], angular node.js, [login to view URL]) applications, developing from scratch and from existing code. I am goo More

€11 EUR / hour
(5 Reviews)
4.8
bluestar1027

*****Hello, dear!!!***** I have read your description carefully. I can handle it with full confidence and have already done this type of projects. Please give me an opportunity to work with you. I am a senior Mobile More

€9 EUR / hour
(3 Reviews)
4.1
saifansari2

will i help you right now NodeJs, Angularjs, MVC ,WCF, Entity Framwork, Canvasjs, Chessjs, Underscorejs, Angular Meterial, Mobile Application Ionic framework, Canvasjs Reporting, Jquery, JSON,WCF,Ms Sql Server, MVC o More

€12 EUR / hour
(15 Reviews)
4.3
billinhit

Hi, I am a nodejs developer. I am seeing the problem in your code. I can help you. Please contact me! Thanks,

€27 EUR / hour
(10 Reviews)
4.0
KongHyongRan

Hi,sir I am interested in your project. I have talent in NodeJS,PostgreSQL I have been worked as Web Designer & developer for over 12 year, And gained rich experiences If you give me chance I will never let you d More

€10 EUR / hour
(6 Reviews)
2.9
geek92sunny

Hi, I am happy to help with NodeJS and PostgreSQL., Send JSON data from NodeJS to Browser. I've previously worked on GPS tracking system [login to view URL] I've developed NetCorp GPS from scratch and depl More

€22 EUR / hour
(0 Reviews)
0.0
itstheaim

Hello, I have read your project details and I would love to work with you. Services: -Backend Development: PHP, Ruby on Rails, Wordpress, Mysql, API, Web Services -Mobile Applications: Android(Java), iPhone & i More

€6 EUR / hour
(0 Reviews)
0.0