mirror of
https://github.com/Akif9748/akf-forum.git
synced 2024-12-22 23:59:08 +03:00
Handler fixed for api
This commit is contained in:
parent
0dd3ab8838
commit
9e01765228
1 changed files with 2 additions and 2 deletions
4
index.js
4
index.js
|
@ -13,8 +13,8 @@ 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."));
|
||||
|
||||
app.listen(port, () => console.log("Akf-forum on port:", port));
|
||||
app.listen(port, () => console.log("Akf-forum on port:", port));
|
||||
|
|
Loading…
Reference in a new issue