2024-08-19 20:06:38 +02:00
|
|
|
import { apiRoute, applyConfig } from "@/api";
|
2024-05-29 02:59:49 +02:00
|
|
|
import { redirect } from "@/response";
|
|
|
|
|
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
|
|
|
});
|
|
|
|
|
|
2024-08-19 20:06:38 +02:00
|
|
|
export default apiRoute((app) =>
|
2024-06-13 04:26:43 +02:00
|
|
|
app.on(meta.allowedMethods, meta.route, () => {
|
2024-05-06 09:16:33 +02:00
|
|
|
return redirect(
|
|
|
|
|
new URL("/.well-known/nodeinfo/2.0", config.http.base_url),
|
|
|
|
|
301,
|
|
|
|
|
);
|
2024-08-19 20:06:38 +02:00
|
|
|
}),
|
|
|
|
|
);
|