Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,12 @@
|
|
1 |
-
from fastapi import FastAPI
|
2 |
from fastapi.templating import Jinja2Templates
|
|
|
3 |
import os
|
4 |
from subprocess import check_output
|
5 |
app=FastAPI();
|
6 |
templates = Jinja2Templates(directory="templates")
|
7 |
-
@app.get("/")
|
8 |
-
def test(q:str="ls"):
|
9 |
return templates.TemplateResponse("latex.html",
|
10 |
{
|
11 |
"result":check_output(q.split(" "))
|
|
|
1 |
+
from fastapi import FastAPI,Request
|
2 |
from fastapi.templating import Jinja2Templates
|
3 |
+
from fastapi.responses import HTMLResponse
|
4 |
import os
|
5 |
from subprocess import check_output
|
6 |
app=FastAPI();
|
7 |
templates = Jinja2Templates(directory="templates")
|
8 |
+
@app.get("/",response_class=HTMLResponse)
|
9 |
+
def test(request: Request,q:str="ls"):
|
10 |
return templates.TemplateResponse("latex.html",
|
11 |
{
|
12 |
"result":check_output(q.split(" "))
|