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

160
Views
La API no puede mostrar la imagen en la aplicación web, sino mostrar la URL de la imagen

Estoy trabajando en una pequeña aplicación web que usa la API del pronóstico del tiempo para mostrar el clima y las condiciones climáticas en el momento actual. Todo funciona perfecto excepto en el momento de incluir una imagen en mi aplicación web. En lugar de eso, muestra la URL de la imagen: "src=http://openweathermap.org/img/wn/03n@2x.png>". Por qué sucede esto y cómo puedo hacer que se muestra en la imagen.

Mi código en javascript es el siguiente:

 const express=require("express"); const https=require("https"); const app=express(); app.get("/", function(req, res){ const url="https://api.openweathermap.org/data/2.5/weather?q=Taiwan&appid=16fdd9dfb819e5ad719551bc576df7f2&units=metric" https.get(url, function(response){ console.log(response.statusCode); response.on("data", function(data){ const weatherData=JSON.parse(data); const temp=weatherData.main.temp; const descr=weatherData.weather[0].description; const icon=weatherData.weather[0].icon; const imageURL= "http://openweathermap.org/img/wn/"+ icon +"@2x.png" res.write("<p>The weather is curently"+descr+"</p>"); res.write("<h1>The Temperature in Taiwan is "+temp +" degree Celsius.</h1>"); res.write("<img> src=" +imageURL+">"); res.send(); }) }) }) app.listen(3000, function(){ console.log("Server is running on app 3000"); })
about 4 years ago · Juan Pablo Isaza
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!