mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-11-22 20:10:40 +03:00
Handler fixed for api
This commit is contained in:
parent
0dd3ab8838
commit
9e01765228
1 changed files with 2 additions and 2 deletions
2
index.js
2
index.js
|
@ -13,7 +13,7 @@ app.set("view engine", "ejs");
|
|||
app.use(express.json());
|
||||
|
||||
for (const file of fs.readdirSync("./routes"))
|
||||
app.use("/" + file.slice(0, -3), require(`./routes/${file}`));
|
||||
app.use("/" + file.replace(".js", ""), require(`./routes/${file}`));
|
||||
|
||||
app.all("*", (req, res) => error(res, 404, "We have not got this page."));
|
||||
|
||||
|
|
Loading…
Reference in a new issue