Files
whattoplay/server/src/features/steam/router.ts

15 lines
420 B
TypeScript

import { zValidator } from "@hono/zod-validator"
import { Hono } from "hono"
import { steamRefreshInput } from "./schema.ts"
import { fetchSteamGames } from "./service.ts"
export const steamRouter = new Hono().post(
"/games",
zValidator("json", steamRefreshInput),
async (c) => {
const { apiKey, steamId } = c.req.valid("json")
const result = await fetchSteamGames(apiKey, steamId)
return c.json(result)
},
)