JC321 commited on
Commit
0e0e09a
·
verified ·
1 Parent(s): 83b398d

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -0
  2. mcp_server_sse.py +14 -4
Dockerfile CHANGED
@@ -16,6 +16,9 @@ COPY edgar_client.py .
16
  COPY financial_analyzer.py .
17
  COPY mcp_server_sse.py .
18
 
 
 
 
19
  # Expose port
20
  EXPOSE 7860
21
 
 
16
  COPY financial_analyzer.py .
17
  COPY mcp_server_sse.py .
18
 
19
+ # Copy templates directory
20
+ COPY templates/ templates/
21
+
22
  # Expose port
23
  EXPOSE 7860
24
 
mcp_server_sse.py CHANGED
@@ -518,10 +518,20 @@ async def root():
518
  html_content = f.read()
519
  return HTMLResponse(content=html_content)
520
  except FileNotFoundError:
521
- return HTMLResponse(
522
- content="<h1>Error: Template file not found</h1><p>Please ensure templates/index.html exists.</p>",
523
- status_code=500
524
- )
 
 
 
 
 
 
 
 
 
 
525
 
526
 
527
  @app.get("/tools")
 
518
  html_content = f.read()
519
  return HTMLResponse(content=html_content)
520
  except FileNotFoundError:
521
+ # Enhanced error message with debugging information
522
+ import os
523
+ debug_info = f"""
524
+ <h1>Error: Template not found</h1>
525
+ <h2>Debugging Information:</h2>
526
+ <p><strong>Looking for:</strong> {template_path.absolute()}</p>
527
+ <p><strong>Exists:</strong> {template_path.exists()}</p>
528
+ <p><strong>Current dir:</strong> {current_dir.absolute()}</p>
529
+ <h3>Directory contents:</h3>
530
+ <pre>{chr(10).join(os.listdir(current_dir))}</pre>
531
+ <h3>Fix:</h3>
532
+ <p>Ensure Dockerfile contains: <code>COPY templates/ templates/</code></p>
533
+ """
534
+ return HTMLResponse(content=debug_info, status_code=500)
535
 
536
 
537
  @app.get("/tools")