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

265
Views
Nodo: la solicitud de colocación no actualiza los datos de la solicitud en el navegador, sino que se actualiza en la línea de comandos, la API meteorológica

Soy un principiante en Node, cuando trato de actualizar la solicitud de API (API del tiempo) en el navegador, nunca cambia, pero si trato de ejecutar en la línea de comandos, pronostica el clima en vivo.

 const express = require("express"); const { all } = require("express/lib/application"); // HTTPS library requrired` const https = require("https"); const app = express(); const port = 3000; app.get("/", function(req, res){ // Getting data from external server const url = "https://api.openweathermap.org/data/2.5/weather?q=Mumbai&appid=---------------------------------&units=metric"; // Adding functions to our own server https.get(url, function(respone){ console.log(respone.statusCode); // Getting data and putting on our server respone.on("data", function(data){ // Parsing the data to an actuall javascript object var allData = JSON.parse(data) const temp = allData.main.temp; const description = allData.weather[0].description; const icon = allData.weather[0].icon; const imageUrl = "http://openweathermap.org/img/wn/"+ icon +"@2x.png" res.write("<p>The weather type here is: "+description+"</p>") res.write("<h1>The temperature here is: "+temp+"</h1>") res.write("<img src = "+imageUrl+"></img>"); res.send(); console.log(allData) }) }) }) app.listen(port, function(){ console.log("Server is running on port 3000"); })

Imagen de la línea de comandos Imagen del navegador

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!