diff --git a/APIDOCS.md b/APIDOCS.md index 767ae60..1dc48ef 100644 --- a/APIDOCS.md +++ b/APIDOCS.md @@ -16,6 +16,9 @@ But in front end, the API will works with session. ## How to request? ### Request types: +- GET `/api/me` to get your account. + + - GET `/api/bans/` fetch all bans. - GET `/api/bans/:id` fetch a ban. - DELETE `/api/bans/:id` for unban an IP adress. diff --git a/README.md b/README.md index 914a636..fbe7b8c 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,8 @@ Edit `config.json` for default themes of users, and forum name... ## API Akf-forum has got an API for AJAX (fetch), other clients etc. And, you can learn about API in `APIDOCS.md`. +**And you can use [offical API wrapper](https://github.com/Akif9748/akf-forum-api).** + ## Credits * [Akif9748](https://github.com/Akif9748) - Project mainteiner, main developer, made **old** frontend * [Tokmak](https://github.com/tokmak0) - Made **new** frontend diff --git a/routes/api/index.js b/routes/api/index.js index e75d5d4..73e3faa 100644 --- a/routes/api/index.js +++ b/routes/api/index.js @@ -33,7 +33,7 @@ app.use(async (req, res, next) => { next(); }); -app.post("/me", (req, res) => res.complate(req.user)) +app.get("/me", (req, res) => res.complate(req.user)) for (const file of fs.readdirSync("./routes/api/routes")) app.use("/" + file.replace(".js", ""), require(`./routes/${file}`));