- Created a new cache-proxy application using NestJS, including essential files such as Dockerfile, .gitignore, and .eslintrc.js. - Implemented core application structure with AppModule, ProxyModule, and ProxyController for handling GraphQL requests. - Configured caching with Redis and established environment variable management using Zod for validation. - Added utility functions for query handling and time management, enhancing the application's functionality. - Included README.md for project documentation and setup instructions.
13 lines
361 B
TypeScript
13 lines
361 B
TypeScript
/* eslint-disable unicorn/prevent-abbreviations */
|
|
import { z } from 'zod';
|
|
|
|
export const envSchema = z.object({
|
|
BOT_TOKEN: z.string(),
|
|
LOGIN_GRAPHQL: z.string(),
|
|
PASSWORD_GRAPHQL: z.string(),
|
|
URL_GRAPHQL: z.string(),
|
|
URL_GRAPHQL_CACHED: z.string().default('http://localhost:5000/proxy/graphql'),
|
|
});
|
|
|
|
export const env = envSchema.parse(process.env);
|