martinezjandrew commited on
Commit
0c4e23b
·
1 Parent(s): ec92041

convered root page to serve html content

Browse files
Files changed (1) hide show
  1. app.py +16 -2
app.py CHANGED
@@ -1,4 +1,5 @@
1
  from fastapi import FastAPI
 
2
  from haystack import Pipeline
3
  from pydantic import BaseModel
4
  from classes import CourseOutline
@@ -8,12 +9,25 @@ app = FastAPI()
8
 
9
  @app.get("/")
10
  async def root():
11
- return {
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  "message": "Welcome to TrainingCourseGen! This is a tool to create generative courses for training managers.",
13
  "github": "https://github.com/Zoqi-Andrew-Senior-Project/ScriboAI-Consumer",
14
  "hugging_face_docs": "https://martinezjandrew-trainingcoursegen.hf.space/docs",
15
  "local_host_docs": "http://localhost:8000",
16
- }
17
 
18
 
19
  class ScriptRequest(BaseModel):
 
1
  from fastapi import FastAPI
2
+ from fastapi.responses import HTMLResponse
3
  from haystack import Pipeline
4
  from pydantic import BaseModel
5
  from classes import CourseOutline
 
9
 
10
  @app.get("/")
11
  async def root():
12
+ content = """
13
+ <html>
14
+ <head>
15
+ <title>TrainingCourseGen</title>
16
+ </head>
17
+ <body>
18
+ <h1>Welcome to TrainingCourseGen!</h1>
19
+ <p>This is a tool to create generative courses for training managers.</p>
20
+ <p>Github for customer-serving side of the project: <a href="url">https://github.com/Zoqi-Andrew-Senior-Project/ScriboAI-Consumer</a>
21
+ <p>Hugging Face Space hosted Docs: <a href="url">https://martinezjandrew-trainingcoursegen.hf.space/docs</a>
22
+ <p>Local host hosted docs: <a href="url">http://localhost:8000</a>
23
+ """
24
+ return HTMLResponse(content=content, status_code=200)
25
+ """return {
26
  "message": "Welcome to TrainingCourseGen! This is a tool to create generative courses for training managers.",
27
  "github": "https://github.com/Zoqi-Andrew-Senior-Project/ScriboAI-Consumer",
28
  "hugging_face_docs": "https://martinezjandrew-trainingcoursegen.hf.space/docs",
29
  "local_host_docs": "http://localhost:8000",
30
+ }"""
31
 
32
 
33
  class ScriptRequest(BaseModel):