Returns empty data, multiple app.get ()

I have to redefine an Express class before / deleteUser before I can make sure that the value read below is not null.
all the code is as follows

/*server.js*/
var express = require("express");    // express
var app = express();
var fs = require("fs");     // 

// 
var user = {
    "user4": {
        "name":"mohit",
        "password":"password4",
        "profession":"teacher",
        "id":4
    }
}

// 
app.get("/listUsers", (req, res) => {
   fs.readFile( __dirname + "/" + "users.json", "utf8", (err, data) => {
       console.log( data );
       res.end( data );
   });
})

// 
app.get("/addUser", (req, res) => {
    // 
    fs.readFile( __dirname + "/" + "users.json", "utf8", (err, data) => {
        if (err) {
            return console.log(err);
        };

        data = JSON.parse(data);    // JSON
        data["user4"] = user["user4"];    
        console.log(data);
        res.end( JSON.stringify(data) );    // JSON
    });
});

// 
app.get("/:id", (req, res) => {
    // 
    fs.readFile( __dirname + "/" + "users.json", "utf8", (err, data) => {
        data = JSON.parse( data );
        var user = data["user" + req.params.id]    // get
        console.log( user );
        res.end( JSON.stringify(user) );
    })
})


var app = express();


// 
app.get("/deleteUser", (req, res) => {

   // 
   fs.readFile( __dirname + "/" + "users.json", "utf8", (err, data) => {
       data = JSON.parse( data );
       delete data["user" + 2];
       
       console.log( data );
       res.end( JSON.stringify(data));
   });
})

// server
var server = app.listen(1937, () => {
    console.log(server.address());
})

delete the user"s previous

var app = express();

must exist. If it is removed, it will return undefined, and cannot read data data.
Why?

Mar.31,2021

because the route app.get ('/: id') captured your / deleteUser request!
if you don't believe it, you can move the get by id route to all routes and then look at it.
: id is not just about numbers!

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3eaf2-2bbac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3eaf2-2bbac.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?