1let myFile = "./myText.txt";
2const fs = require("fs");
3
4app.all('/test', async (req, res) => {
5 try {
6 const readData = fs.readFileSync(myFile, 'utf8');
7 if (readData) {
8 res.send(readData)
9 }
10 } catch (error) {
11 res.send("something is wrong", error)
12 }
13})