Initial commit

This commit is contained in:
2025-11-01 12:16:01 -07:00
commit 8383b6f63e
15 changed files with 1194 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import type { Context } from "elysia";
import { MySql2Database } from "drizzle-orm/mysql2";
import { launcherUpdates } from "../../../lib/tables";
import { eq } from "drizzle-orm";
import { jsonResponse } from "../../../lib/util";
export async function handler(context: Context, db: MySql2Database) {
const versionsRaw = await db.select({
id: launcherUpdates.id,
releaseDate: launcherUpdates.releaseDate,
downloadUrls: launcherUpdates.downloadUrls,
platforms: launcherUpdates.platforms
})
.from(launcherUpdates)
.where(eq(launcherUpdates.hidden, false))
.orderBy(launcherUpdates.place)
.limit(1)
.execute()
const versions = versionsRaw.map(v => ({
...v,
downloadUrls: JSON.parse(v.downloadUrls),
platforms: JSON.parse(v.platforms)
}))
return jsonResponse(versions[0])
}