rudeshark.net/packages/backend/src/server/api/endpoints/patrons.ts
ThatOneCalculator 1f60f89d81 test api docs
2022-11-19 01:15:35 -08:00

28 lines
628 B
TypeScript

import define from '../define.js';
export const meta = {
tags: ['meta'],
summary: 'Get list of Calckey patrons from Codeberg',
requireCredential: false,
requireCredentialPrivateMode: false,
} as const;
export const paramDef = {
type: 'object',
properties: {},
required: [],
} as const;
// eslint-disable-next-line import/no-default-export
export default define(meta, paramDef, async () => {
let patrons;
await fetch('https://codeberg.org/thatonecalculator/calckey/raw/branch/develop/patrons.json')
.then((response) => response.json())
.then((data) => {
patrons = data['patrons'];
});
return patrons;
});