File size: 1,154 Bytes
623e14e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Configuration module for the DOCX to PDF converter
"""

import os
from typing import List

class Config:
    """Application configuration"""
    
    # File handling
    MAX_FILE_SIZE = int(os.environ.get("MAX_FILE_SIZE", 50 * 1024 * 1024))  # 50MB default
    SUPPORTED_MIME_TYPES: List[str] = [
        "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    ]
    ALLOWED_EXTENSIONS: List[str] = [".docx"]
    
    # Conversion settings
    MAX_CONVERSION_TIME = int(os.environ.get("MAX_CONVERSION_TIME", 120))  # 2 minutes
    TEMP_DIR = os.environ.get("TEMP_DIR", "/tmp/conversions")
    
    # API settings
    API_TITLE = "Enhanced DOCX to PDF Converter"
    API_DESCRIPTION = "Professional API for converting DOCX files to PDF with perfect formatting preservation"
    API_VERSION = "2.0.0"
    
    # CORS settings
    CORS_ORIGINS = os.environ.get("CORS_ORIGINS", "*").split(",")
    CORS_CREDENTIALS = os.environ.get("CORS_CREDENTIALS", "true").lower() == "true"
    CORS_METHODS = os.environ.get("CORS_METHODS", "*").split(",")
    CORS_HEADERS = os.environ.get("CORS_HEADERS", "*").split(",")