StackExchange API undefined results
up vote
0
down vote
favorite
I'm trying to query StackExchange API with this project , but result logs "undefined"
var http = require('http');
var stackexchange = require('stackexchange');
require('dotenv').config();
var options = { version: 2.2 };
var context = new stackexchange(options);
var filter = {
key: process.env.API_KEY,
pagesize: 50,
tagged: 'node.js',
sort: 'activity',
order: 'asc'
};
context.questions.questions(filter, function(err, results) {
if( err ) throw error;
console.log(results.items)
console.log(results.has_more);
});
http.createServer(function(req, res) {
res.write('Servidor ok');
res.end();
}).listen(3000);
What am I missing? How can I get results?
node.js stackexchange-api
add a comment |
up vote
0
down vote
favorite
I'm trying to query StackExchange API with this project , but result logs "undefined"
var http = require('http');
var stackexchange = require('stackexchange');
require('dotenv').config();
var options = { version: 2.2 };
var context = new stackexchange(options);
var filter = {
key: process.env.API_KEY,
pagesize: 50,
tagged: 'node.js',
sort: 'activity',
order: 'asc'
};
context.questions.questions(filter, function(err, results) {
if( err ) throw error;
console.log(results.items)
console.log(results.has_more);
});
http.createServer(function(req, res) {
res.write('Servidor ok');
res.end();
}).listen(3000);
What am I missing? How can I get results?
node.js stackexchange-api
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm trying to query StackExchange API with this project , but result logs "undefined"
var http = require('http');
var stackexchange = require('stackexchange');
require('dotenv').config();
var options = { version: 2.2 };
var context = new stackexchange(options);
var filter = {
key: process.env.API_KEY,
pagesize: 50,
tagged: 'node.js',
sort: 'activity',
order: 'asc'
};
context.questions.questions(filter, function(err, results) {
if( err ) throw error;
console.log(results.items)
console.log(results.has_more);
});
http.createServer(function(req, res) {
res.write('Servidor ok');
res.end();
}).listen(3000);
What am I missing? How can I get results?
node.js stackexchange-api
I'm trying to query StackExchange API with this project , but result logs "undefined"
var http = require('http');
var stackexchange = require('stackexchange');
require('dotenv').config();
var options = { version: 2.2 };
var context = new stackexchange(options);
var filter = {
key: process.env.API_KEY,
pagesize: 50,
tagged: 'node.js',
sort: 'activity',
order: 'asc'
};
context.questions.questions(filter, function(err, results) {
if( err ) throw error;
console.log(results.items)
console.log(results.has_more);
});
http.createServer(function(req, res) {
res.write('Servidor ok');
res.end();
}).listen(3000);
What am I missing? How can I get results?
node.js stackexchange-api
node.js stackexchange-api
asked Nov 19 at 14:06
tramada
107110
107110
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53376377%2fstackexchange-api-undefined-results%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown