GeoJson from Geoserver using node.js

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.

Problem courtesy of: SSA

我来评几句
登录后评论

已发表评论数()

相关站点

+订阅
热门文章