This commit is contained in:
dylan
2024-03-25 00:29:43 -07:00
parent 334c09df7c
commit f960083e94
8 changed files with 213 additions and 26 deletions

View File

@ -1,8 +1,6 @@
CREATE TABLE games (
CREATE TABLE repos (
id text,
name text, -- user defined
repo_fullname text, -- e.g. "username/reponame"
repo_hosttype text, -- "github", "gitea", "gitlab", ...
repo_token text, -- an api auth token to read from the repo
user_id text
)

View File

@ -1,7 +1,7 @@
CREATE TABLE game_instances (
CREATE TABLE releases (
id text,
game_id text,
cart_data text,
created_at time,
is_official boolean
repo_id text,
release_number integer,
cart_png_base64 text,
created_at time
)

24
src/server/api/release.ts Normal file
View File

@ -0,0 +1,24 @@
import { Type } from "@sinclair/typebox";
import { FirRouteInput, FirRouteOptions } from "../util/routewrap.js";
const method = "POST";
const url = "/release";
// const payloadT = Type.Object({
// png: Type.String(),
// });
const payloadT = Type.Any();
const handler = ({payload}: FirRouteInput<typeof payloadT>) => {
const {png} = payload;
console.log(png);
// return payload;
};
export default {
method,
url,
payloadT,
handler,
} as const satisfies FirRouteOptions<typeof payloadT>;

View File

@ -1,9 +1,11 @@
import echo from "./api/echo.ts";
import release from "./api/release.ts";
import webhook from "./api/webhook.ts";
export const routeList = [
echo,
webhook,
release,
];
export type RouteList = typeof routeList;