Answer the question
In order to leave comments, you need to log in
How to make permission to open pages for user-agent on Node js?
I have an application to serve static html files to node js using express
app.get("/app/:type", async(req, res) => {
if (!req.query.host || !req.query.key) return res.end("error");
if (["1", "2", "3"].indexOf(req.params.type) === -1) res.end(":)")
if (!fs.existsSync("./appfile/" + req.params.type + ".txt")) res.end("error")
var file = await readFile("./appfile/" + req.params.type + ".txt");
res.end(file);
});
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