feat: Improve Windows deployment and fix production paths
Data Entry App: - Fix shared path finding for both dev and production environments - Add base URL support for IIS subdirectory deployment (/data-entry/) - Use import.meta.env.BASE_URL in router for correct path handling - Add email-validator and python-jose dependencies Deployment Scripts: - Enhance Build-ROA2WEB.ps1 with improved build process - Update ROA2WEB-Console.ps1 with Data Entry support - Improve Publish-And-Deploy.ps1 deployment workflow - Update deploy-config.json with new settings Gitignore: - Add more build cache patterns to ignore - Add temp frontend build directories 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -22,8 +22,26 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
# Add shared modules to path
|
||||
project_root = Path(__file__).parent.parent.parent.parent
|
||||
sys.path.insert(0, str(project_root / "shared"))
|
||||
# Development: data-entry-app/backend/app/main.py -> 4 parents to project root
|
||||
# Production: data-entry-backend/app/main.py -> 3 parents to roa2web root
|
||||
def find_shared_path():
|
||||
"""Find shared folder - works in both dev and production."""
|
||||
current = Path(__file__).parent # app/
|
||||
|
||||
# Try different parent levels to find shared folder
|
||||
for levels in range(1, 6):
|
||||
candidate = current
|
||||
for _ in range(levels):
|
||||
candidate = candidate.parent
|
||||
shared_path = candidate / "shared"
|
||||
if shared_path.exists() and (shared_path / "auth").exists():
|
||||
return shared_path
|
||||
|
||||
# Fallback to original logic
|
||||
return Path(__file__).parent.parent.parent.parent / "shared"
|
||||
|
||||
shared_path = find_shared_path()
|
||||
sys.path.insert(0, str(shared_path))
|
||||
|
||||
from app.config import settings
|
||||
from app.db.database import init_db
|
||||
|
||||
Reference in New Issue
Block a user