|
|
8 år sedan | |
|---|---|---|
| config | 8 år sedan | |
| lib | 8 år sedan | |
| migrations | 8 år sedan | |
| models | 8 år sedan | |
| routes | 8 år sedan | |
| test | 8 år sedan | |
| .gitignore | 8 år sedan | |
| LICENSE | 8 år sedan | |
| README.md | 8 år sedan | |
| package.json | 8 år sedan | |
| server.js | 8 år sedan |
This is the backend (or 'api component') of the forum software to go along with the corresponding frontend project.
All API routes are prefixed /api/v1/
All sub-routes require admin privileges
POST
{
id: <integer>,
token: <string>
}
All sub-routes require admin privileges
POSTmessage <string>username <string>canCreateThreads <boolean>canCreatePosts <boolean>ipBanned <boolean>
{
id: <integer>,
message: <string>,
canCreateThreads: <boolean>,
canCreatePosts: <boolean>,
ipBanned: <boolean>,
User: {
id: <integer>,
username: <string>,
description: <null | string>,
color: <string>,
createdAt: <string>
}
GET
[{
id: <integer>,
createdAt: <string>,
updatedAt: <string>,
canCreatePosts: <boolean>,
canCreateThreads: <boolean>,
ipBanned: <boolean>,
message: <string>,
UserId: <integer>
}, ...]
DELETEid <integer>
{ success: true }
GET
[{
color: <string>,
createdAt: <string>,
id: <integer>,
name: <string>,
updatedAt: <string>,
value: <string>
}, ...]
GETcategory <string>username <string, optional>from <integer, optional>limit <integer, optional>
{
name: <string>,
value: <string>,
color: <string>,
[id: <integer>],
[createdAt: <string>],
[updatedAt: <string>],
Threads: [ ... ],
meta: {
nextURL: <string | null>,
nextThreadsCount: <integer>
}
}
POSTname <string>color <string, optional>
{
color: <string>,
createdAt: <string>,
id: <integer>,
name: <string>,
updatedAt: <string>,
value: <string>
}
PUTid <integer>name <string, optional>color <string, optional>
{
color: <string>,
createdAt: <string>,
id: <integer>,
name: <string>,
updatedAt: <string>,
value: <string>
}
DELETEid <integer>
{
success: true,
otherCategoryCreated: <category object | null>
}