fix: make STEAM_API_KEY optional so the proxy starts without it

The proxy now boots without a key; /items routes still return 500 when a key is required but missing.
This commit is contained in:
2026-08-08 11:28:58 +08:00
parent 7c812a109c
commit 4ffe858c36
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ describe('loadEnv', () => {
});
});
it('throws when STEAM_API_KEY is missing', () => {
expect(() => loadEnv({})).toThrow(/STEAM_API_KEY/);
it('allows a missing STEAM_API_KEY', () => {
expect(loadEnv({})).toEqual({ PORT: 3000 });
});
it('throws on an invalid PORT', () => {
+2 -2
View File
@@ -1,7 +1,7 @@
import { z } from 'zod';
const envSchema = z.object({
STEAM_API_KEY: z.string().min(1, 'STEAM_API_KEY is required'),
STEAM_API_KEY: z.string().min(1).optional(),
PORT: z.coerce.number().int().min(1).max(65535).default(3000),
});
@@ -9,7 +9,7 @@ export type Env = z.infer<typeof envSchema>;
/** Hono bindings type so `c.env` is typed in route handlers. */
export interface Bindings {
STEAM_API_KEY: string;
STEAM_API_KEY?: string;
PORT: number;
}