openweather API, problem with reading “lat” and “lon” using geocoding in node.js

I was trying to write a program with node.js , using openweather API. in which user would enter the name of the city, then using provided Geocoding API extracting the latitude and longitude coordinates, and then implementing those coordinates to get weather data from current weather API. but somehow I get an error telling me “lat” and “lot” properties can not be read.

here is what I wrote in node:

const express = require("express");
const bodyParser = require("body-parser");

const app = express();

app.use(bodyParser.urlencoded({extended: true}));

var apiKey = "-hidden-";

app.get("/", function(req, res){
    res.sendFile(__dirname+"/index.html")
})

app.post("/", function(req, res){
    var cityName = req.body.cName;
    var geoCodingApi = "http://api.openweathermap.org/geo/1.0/direct?q="+cityName+"&appid="+apiKey;
    var latitude = geoCodingApi.body.lat;
    var longitude = geoCodingApi.body.lon;
    var openWeather = "https://api.openweathermap.org/data/2.5/weather?lat="+latitude+"&lon="+longitude+"&appid="+apiKey;
    res.send(openWeather)
})

app.listen(3000, function(){
    console.log("Server is running on port 3000")
})

and this is my HTML code:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Open Weather API</title>
  </head>
  <body>
    <form action="/" method="post">
      <label for="">Enter City Name</label>
      <input type="text" name="cName" />
      <button type="submit">Submit</button>
    </form>
  </body>
</html>

and here is the result:

TypeError: Cannot read properties of undefined (reading 'lat')

Can’t figure out what the problem is.