Parse Error NodeJs
Estou começando a desenvolver em back end através de NodeJs mas hoje me encontrei em um beco sem saida,
durante a tentativa de fazer teste local para a aplicação me encontrei com o seguinte erro
events.js:141
throw er; // unhandled 'error' event
^
error: getaddrinfo ENOTFOUND http://localhost http://localhost:3306
at errnoExcpetion (dns.js:26:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:77:26)
e meu code é o seguinte :
var http = require('http');
var configuracoes = {
host:'[http://localhost](http://localhost)',
port:3306,
path:'produtos',
method:'get',
headers: {
'Accept':'application/json'
}
};
http.get(configuracoes,function(res){
console.log(res.statusCode);
res.on('data',function(body){
console.log('Corpo: '+body);
});
});Discussão (2)
Carregando comentários...