Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
¿Por qué no puedo obtener datos de respuesta JSON en Javascript? con axios+express

Estoy tratando de obtener la letra como respuesta a esta solicitud de letra simple (de una canción de Eminem, por ejemplo), no me da ningún error, pero no entiendo por qué no recibo la respuesta. ¿Qué me estoy perdiendo? Por favor, ayúdame :)

 app.get('/lyrics', function(req, res) { axios.get('https://api.lyrics.ovh/v1/eminem/stan') .then(function(data) { let result = { lyrics : data['lyrics'], }; res.status(200).send(result); }) .catch(function(err) { if(err['statusCode'] == 404) res.send({error : {status : 404, message : 'Lyrics not found'}}); else res.send(err); }) .then(function () { // always executed }); });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Como Phil mencionó, edite su código a esto y estará bien

 app.get('/lyrics', function(req, res) { axios.get('https://api.lyrics.ovh/v1/eminem/stan') .then(function(data) { let result = { lyrics : data.data.lyrics, }; res.status(200).send(result); }) .catch(function(err) { if(err['statusCode'] == 404) res.send({error : {status : 404, message : 'Lyrics not found'}}); else res.send(err); }) .then(function () { }); });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!