Answer the question
In order to leave comments, you need to log in
How to check if a file exists on the server by making a get request to the express.js server?
It is necessary to check the existence of a file on the server by sending a request from the frontend, how and what is the best way to implement this?
I try like this
if (fs.existsSync('product.js')) {
console.log('OK')
} else {
console.log('Not found')
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question