fix: resolve TypeScript compilation errors in API
- Add explicit IRouter type to all route files - Add explicit Express type to app.ts - Fix env.ts by moving getCorsOrigins after parsing - Fix token.ts SignOptions type for expiresIn - Cast req.params.id to String() in controllers Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -15,11 +15,6 @@ const envSchema = z.object({
|
||||
CORS_ORIGIN: z.string().default('http://localhost:3000'),
|
||||
});
|
||||
|
||||
// Parse CORS origins (comma-separated) into array
|
||||
export function getCorsOrigins(): string[] {
|
||||
return parsed.data.CORS_ORIGIN.split(',').map(origin => origin.trim());
|
||||
}
|
||||
|
||||
const parsed = envSchema.safeParse(process.env);
|
||||
|
||||
if (!parsed.success) {
|
||||
@@ -28,3 +23,8 @@ if (!parsed.success) {
|
||||
}
|
||||
|
||||
export const env = parsed.data;
|
||||
|
||||
// Parse CORS origins (comma-separated) into array
|
||||
export function getCorsOrigins(): string[] {
|
||||
return env.CORS_ORIGIN.split(',').map(origin => origin.trim());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user