Added apidocs for /me path

This commit is contained in:
Akif9748 2022-09-09 21:40:02 +03:00
parent 980deb7db2
commit aa0bd09efd
3 changed files with 6 additions and 1 deletions

View file

@ -16,6 +16,9 @@ But in front end, the API will works with session.
## How to request? ## How to request?
### Request types: ### Request types:
- GET `/api/me` to get your account.
- GET `/api/bans/` fetch all bans. - GET `/api/bans/` fetch all bans.
- GET `/api/bans/:id` fetch a ban. - GET `/api/bans/:id` fetch a ban.
- DELETE `/api/bans/:id` for unban an IP adress. - DELETE `/api/bans/:id` for unban an IP adress.

View file

@ -13,6 +13,8 @@ Edit `config.json` for default themes of users, and forum name...
## API ## API
Akf-forum has got an API for AJAX (fetch), other clients etc. And, you can learn about API in `APIDOCS.md`. 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 ## Credits
* [Akif9748](https://github.com/Akif9748) - Project mainteiner, main developer, made **old** frontend * [Akif9748](https://github.com/Akif9748) - Project mainteiner, main developer, made **old** frontend
* [Tokmak](https://github.com/tokmak0) - Made **new** frontend * [Tokmak](https://github.com/tokmak0) - Made **new** frontend

View file

@ -33,7 +33,7 @@ app.use(async (req, res, next) => {
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")) for (const file of fs.readdirSync("./routes/api/routes"))
app.use("/" + file.replace(".js", ""), require(`./routes/${file}`)); app.use("/" + file.replace(".js", ""), require(`./routes/${file}`));