How to run Nodejs Sever Nodemon? [closed]

  api, c++, node.js

I’m Not Run in my Node Js Sever In Nodemon!
I’m see YouTube & All resources not find the! solution!
please Anyone Help me! I’m Created By Weather App in Node Js! Dynamic Website!
So, Plesse Help me!!

const fs =require ("fs");
var requests = require("requests");
const { Server } = require("node:http");
const { listeners } = require("node:process");

const homeFile = fs.readFileSync("home.html","utf-8");


const replaceVal = (tempval , Orgval) =>{
    let temperature = tempval.replace("{%tempval%}",Orgval.main.temp);
    temperature = temperature.replace("{%tempmin%}",Orgval.main.temp_min);
    temperature = temperature.replace("{%tempmax%}",Orgval.main.temp_max);
    temperature = temperature.replace("{%location%}",Orgval.main.name);
    temperature = temperature.replace("{%country%}",Orgval.main.sys.country);

    return temperature;
};

const server = http.createServer((req,res) =>{
  if(req.url="/"){
     requests("https//api.openweathermap.org/data/2.5/weather?q=bogra=metric&appid={d4c0e8ec9ae9b512bb0ce5379ccbb8ef}", 
     { streaming })
     
    .on('data', (chunk) => {
     const objdata=JSON.parse(chunk);
     const arrData=[objdata];
     //console.log(arrData[0].main.tamp);
     const realTimeData = arrData.map(val => replaceVal(homeFile,val))
     .join("");
     res.write(realTimeData); 

   })
    .on('end',(err) => {
      if (err) return console.log('connection closed due to errors', err);
       res.end();
        });


  }

});
Server.listen(8000,"127.0.0.1");```


That the All Code but I'm Not my Run Sever ? 

Source: Windows Questions C++

LEAVE A COMMENT