mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 22:09:16 +01:00
Add WebFinger endpoints
This commit is contained in:
parent
ee6b6bce34
commit
ae9698c647
7 changed files with 34 additions and 17 deletions
23
server/api/well-known/nodeinfo/index.ts
Normal file
23
server/api/well-known/nodeinfo/index.ts
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { apiRoute, applyConfig } from "@api";
|
||||
import { redirect } from "@response";
|
||||
|
||||
export const meta = applyConfig({
|
||||
allowedMethods: ["GET"],
|
||||
auth: {
|
||||
required: false,
|
||||
},
|
||||
ratelimits: {
|
||||
duration: 60,
|
||||
max: 60,
|
||||
},
|
||||
route: "/.well-known/nodeinfo",
|
||||
});
|
||||
|
||||
export default apiRoute(async (req, matchedRoute, extraData) => {
|
||||
const config = await extraData.configManager.getConfig();
|
||||
|
||||
return redirect(
|
||||
new URL("/.well-known/nodeinfo/2.0", config.http.base_url),
|
||||
301,
|
||||
);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue