Answer the question
In order to leave comments, you need to log in
How to make an api request in express js?
How can I get data from api in Express js, for example from https://jsonplaceholder.typicode.com/todos/1
I have an api that does not work on the client, I need to get it on the server and send it to the frontend.
How can I do that?
Answer the question
In order to leave comments, you need to log in
Library Here
var request = require('request');
request('https://jsonplaceholder.typicode.com/todos/1', function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body)
}
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question