hippofish/packages/backend/src/server/api/endpoints/release.ts

30 lines
555 B
TypeScript
Raw Normal View History

2023-01-13 05:40:33 +01:00
import define from "../define.js";
2023-01-04 02:38:07 +01:00
export const meta = {
2023-01-13 05:40:33 +01:00
tags: ["meta"],
description: "Get release notes from Codeberg",
2023-01-04 02:38:07 +01:00
requireCredential: false,
requireCredentialPrivateMode: false,
} as const;
export const paramDef = {
2023-01-13 05:40:33 +01:00
type: "object",
2023-01-04 02:38:07 +01:00
properties: {},
required: [],
} as const;
2023-01-13 05:54:33 +01:00
2023-01-04 02:38:07 +01:00
export default define(meta, paramDef, async () => {
2023-01-04 02:43:12 +01:00
let release;
2023-01-13 05:40:33 +01:00
await fetch(
"https://codeberg.org/calckey/calckey/raw/branch/develop/release.json",
)
2023-01-04 02:38:07 +01:00
.then((response) => response.json())
.then((data) => {
2023-01-04 02:43:12 +01:00
release = data;
2023-01-04 02:38:07 +01:00
});
2023-01-04 02:43:12 +01:00
return release;
2023-01-04 02:38:07 +01:00
});