Answer the question
In order to leave comments, you need to log in
How to get get request in node.js?
To receive it, you need to configure receiving in nginx? It looks like this for me:
location / vk {
proxy_pass http://127.0.0.1:81;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Answer the question
In order to leave comments, you need to log in
shta?
You send the user to the vk.auth/bla_bla link. Vkontakte redirects the user to the redirect_url (the link you provided) + adds its own GET parameters. All you need to do is add a processing route and get the GET parameters you are interested in
app.get('/vk/callback', function(req, res){
var code = req.query.code;
});
var request = require("request");
request("api_url", function(error, response, body) {
console.log(body);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question