server/api/well-known/nodeinfo/index.ts

27 lines
606 B
TypeScript
Raw Normal View History

import { apiRoute, applyConfig } from "@/api";
import { config } from "~/packages/config-manager";
2023-10-16 19:39:41 +02:00
export const meta = applyConfig({
2024-04-07 07:30:49 +02:00
allowedMethods: ["GET"],
auth: {
required: false,
},
ratelimits: {
duration: 60,
max: 60,
},
route: "/.well-known/nodeinfo",
2023-10-16 19:39:41 +02:00
});
export default apiRoute((app) =>
app.on(meta.allowedMethods, meta.route, (context) => {
return context.redirect(
new URL(
"/.well-known/nodeinfo/2.0",
config.http.base_url,
).toString(),
301,
);
}),
);