--- /dev/null
+import { server } from '../../lib/server';
+import { Static, Type } from '@sinclair/typebox';
+import { prisma } from '../../lib/db';
+import { ForbiddenError } from '../../lib/http-errors';
+import {Player} from '@prisma/client';
+
+const PlayerInput = Type.Object({
+ params: Type.Object({
+ playerId: Type.String()
+ })
+});
+
+type PlayerInputType = Static<typeof PlayerInput>;
+
+export const playerInfo = server.get<PlayerInputType, Player>('/v1/accounts/:playerId', {
+ schema: PlayerInput,
+ authenicated: true
+}, async req => {
+ const player = await prisma.player.findUnique({
+ where: {
+ id: req.params.playerId
+ }
+ });
+
+ if(!player) {
+ throw new ForbiddenError('Not allowed');
+ }
+
+ return player;
+});