mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09: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
|
|
@ -1,9 +1,23 @@
|
|||
import { applyConfig } from "@api";
|
||||
import { errorResponse } from "@response";
|
||||
import { MatchedRoute } from "bun";
|
||||
import { randomBytes } from "crypto";
|
||||
import { Application } from "~database/entities/Application";
|
||||
import { Token } from "~database/entities/Token";
|
||||
import { User } from "~database/entities/User";
|
||||
import { APIRouteMeta } from "~types/api";
|
||||
|
||||
export const meta: APIRouteMeta = applyConfig({
|
||||
allowedMethods: ["POST"],
|
||||
ratelimits: {
|
||||
max: 4,
|
||||
duration: 60,
|
||||
},
|
||||
route: "/auth/login",
|
||||
auth: {
|
||||
required: false,
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* OAuth Code flow
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue