All files / src/config config.ts

66.66% Statements 14/21
50% Branches 13/26
65% Functions 13/20
66.66% Lines 14/21

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 409x         7x 7x 7x     19x 27x 12x 82x 24x     3x 3x 16x 6x                     13x                
export const config = {
    mongo: {
        uri: () => process.env.DB_CONNECTION || 'mongodb://localhost:27017'
    },
    app: {
        port: () => process.env.PORT || 3000,
        frontend_url: () => process.env.FRONTEND_URL || 'http://localhost:5000',
        backend_url: () => process.env.BACKEND_URL || `http://localhost:${config.app.port()}`,
    },
    token: {
        refresh_token_expiration: () => process.env.REFRESH_TOKEN_EXPIRATION || '3d',
        token_expiration: () => process.env.TOKEN_EXPIRATION || '100000s',
        salt: () => process.env.SALT || 10,
        access_token_secret: () => process.env.ACCESS_TOKEN_SECRET || 'secret',
        refresh_token_secret: () => process.env.REFRESH_TOKEN_SECRET || 'secret'
    },
    resources: {
        imagesDirectoryPath: () => 'resources/images',
        imageMaxSize: () => 10 * 1024 * 1024, // Max file size: 10MB
        resumesDirectoryPath: () => 'resources/resumes',
        resumeMaxSize: () => 5 * 1024 * 1024 // Max file size: 5MB
    },
    assets: {
        resumeTemplatesDirectoryPath: () => 'assets/resume-templates',
        jobQuizzesJobHuntHtmlPath: () => 'assets/job-quizzes/jobhunt/מאגר שאלות מראיונות עבודה.html',
        jobQuizzesTheWorkerHtmlDirectoryPath: () => 'assets/job-quizzes/theworker/interviews',
    },
    chatAi: {
        api_url: () => process.env.CHAT_AI_API_URL || 'https://openrouter.ai/api/v1/chat/completions',
        api_key: () => process.env.OPENROUTER_API_KEY || undefined,
        model_name: () => process.env.OPENROUTER_MODEL_NAME || 'google/gemma-3-27b-it:free',
        turned_on: () =>  process.env.CHAT_AI_TURNED_ON === 'true' || false
    },
    socketMethods: {
        messageFromServer: "message-from-server",
        messageFromClient: "message-from-client",
        onlineUsers: "online-users",
        enterRoom: "enter-room"
    }
}