Skip to content

server/api methods look for ewa #2

Description

@staminna

Hi
I am trying to make a request using the server/api methods but it cannot find ewa.
I thought it wouldn't be necessary for this. Here's what I am doing.

'var http = require('http'),
URL = require('url'),
getElements = require('node-bot').getElements;

module.exports = {
foo: function () {
handleRequest();
},
bar: function () {
google_node_bot();
}
};

var handleRequest = function (request, response) {

var url = 'http://localhost:8999/getelements?name=nike_shoes&search=nike%20lebron%209&regexp=%5C%24%7C%C3%A2%E2%80%9A%C2%AC';

var qs = URL.parse(url);

if (qs.pathname == '/getelements'){
getElements(qs.query,response);
};
console.log(response);
};

function google_node_bot(){
console.log("google_node_bot is up");
http.createServer(handleRequest).listen(8999);
};
'

I think the only difference is I am passing the request url as a variable.
Thanks.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions