mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
New API route format to make code cleaner
This commit is contained in:
parent
c7b2f5b741
commit
ca7d325cb1
36 changed files with 600 additions and 237 deletions
12
types/api.ts
Normal file
12
types/api.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export interface APIRouteMeta {
|
||||
allowedMethods: ("GET" | "POST" | "PUT" | "DELETE" | "PATCH")[];
|
||||
ratelimits: {
|
||||
max: number;
|
||||
duration: number;
|
||||
};
|
||||
route: string;
|
||||
auth: {
|
||||
required: boolean;
|
||||
requiredOnMethods?: ("GET" | "POST" | "PUT" | "DELETE" | "PATCH")[];
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue