edithram23 commited on
Commit
8970b97
·
verified ·
1 Parent(s): a5deb9e

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +17 -1
main.py CHANGED
@@ -54,7 +54,23 @@ async def read_form():
54
  # Handle the form submission
55
  @app.post("/submit")
56
  async def submit_form(message: str = Form(...)):
57
- return {"message": message}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  # @app.get("/")
59
  # async def hello():
60
  # return {"msg" : "Live"}
 
54
  # Handle the form submission
55
  @app.post("/submit")
56
  async def submit_form(message: str = Form(...)):
57
+ html_content = f"""
58
+ <!DOCTYPE html>
59
+ <html>
60
+ <head>
61
+ <title>FastAPI Input Form</title>
62
+ </head>
63
+ <body>
64
+ <h1>Enter Your Message</h1>
65
+ <form action="/submit" method="post">
66
+ <p>{mask_generation(message)}</p>
67
+ <input type="text" id="message" name="message">
68
+ <input type="submit" value="Submit">
69
+ </form>
70
+ </body>
71
+ </html>
72
+ """
73
+ return html_content
74
  # @app.get("/")
75
  # async def hello():
76
  # return {"msg" : "Live"}