mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
Add more API route definitions
This commit is contained in:
parent
a8d8b70239
commit
7f2e89ab20
10 changed files with 140 additions and 10 deletions
|
|
@ -1,5 +1,18 @@
|
|||
import { applyConfig } from "@api";
|
||||
import { MatchedRoute } from "bun";
|
||||
|
||||
export const meta = applyConfig({
|
||||
allowedMethods: ["GET"],
|
||||
auth: {
|
||||
required: false,
|
||||
},
|
||||
ratelimits: {
|
||||
duration: 60,
|
||||
max: 20,
|
||||
},
|
||||
route: "/oauth/authorize",
|
||||
});
|
||||
|
||||
/**
|
||||
* Returns an HTML login form
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,7 +1,20 @@
|
|||
import { applyConfig } from "@api";
|
||||
import { parseRequest } from "@request";
|
||||
import { errorResponse, jsonResponse } from "@response";
|
||||
import { Token } from "~database/entities/Token";
|
||||
|
||||
export const meta = applyConfig({
|
||||
allowedMethods: ["POST"],
|
||||
auth: {
|
||||
required: false,
|
||||
},
|
||||
ratelimits: {
|
||||
duration: 60,
|
||||
max: 10,
|
||||
},
|
||||
route: "/oauth/token",
|
||||
});
|
||||
|
||||
/**
|
||||
* Allows getting token from OAuth code
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue