22 lines
605 B
TypeScript
22 lines
605 B
TypeScript
|
import { Controller, Get } from "elysia-decorators";
|
||
|
import { t } from "elysia";
|
||
|
import { ReplayService } from "../service/replay.service";
|
||
|
|
||
|
@Controller("/replay")
|
||
|
export default class ReplayController {
|
||
|
@Get("/:playerId/:leaderboardId", {
|
||
|
config: {},
|
||
|
params: t.Object({
|
||
|
playerId: t.String({ required: true }),
|
||
|
leaderboardId: t.String({ required: true }),
|
||
|
}),
|
||
|
})
|
||
|
public async getOpenGraphImage({
|
||
|
params: { playerId, leaderboardId },
|
||
|
}: {
|
||
|
params: { playerId: string; leaderboardId: string };
|
||
|
}) {
|
||
|
return ReplayService.getReplay(playerId, leaderboardId);
|
||
|
}
|
||
|
}
|