fix: Use Zod in the actor.ts file

This commit is contained in:
Wanjohi
2025-10-27 05:51:44 +03:00
parent ef5e626c9d
commit 3d3a303eb9
3 changed files with 63 additions and 38 deletions

View File

@@ -28,8 +28,9 @@ app
});
})
.use(
validator("header", z.object({ "x-nestri-member": z.string().optional() })),
validator("header", z.object({ "x-nestri-steam": z.string().optional() })),
)
.use(validator("query", z.object({ steamID: z.string().optional() })))
.use(auth)
.use(cors());
@@ -86,15 +87,15 @@ app.get(
scheme: "bearer",
bearerFormat: "JWT",
},
MemberID: {
SteamID: {
type: "apiKey",
description: "The member ID to use for this query",
description: "The steamID to use for this query",
in: "header",
name: "x-nestri-member",
name: "x-nestri-steam",
},
},
},
security: [{ Bearer: [], MemberID: [] }],
security: [{ Bearer: [], SteamID: [] }],
servers: [
{ description: "Production", url: "https://api.nestri.io" },
{ description: "Sandbox", url: "https://api.dev.nestri.io" },
@@ -102,3 +103,8 @@ app.get(
},
}),
);
export default {
port: 3001,
fetch: app.fetch,
};