I am new to Node.js, learning with examples.
Here is what I am trying to do, I have a geoserver running to serve GeoJson, I want to call geoserver WFS url and get json data using node.js. Here is code, when I run it, I get :
getaddrinfo ENOENT
var http = require('http');
var options = {
host: "local:8080/geoserver/wfs?service=WFS&version=1.0.0&request=GetFeature&typeName=layername&outputFormat=JSON&cql_filter=id=1";
path: '/'
}
var request = http.request(options, function (res) {
var data = '';
res.on('data', function (chunk) {
data += chunk;
});
res.on('end', function () {
console.log(data);
});
});
request.on('error', function (e) {
console.log(e.message);
});
request.end();
Please guide me in right direction. Thank you.