David Li commited on
Commit
aa1499d
·
1 Parent(s): 2853f16

fix: update requirements

Browse files
Files changed (2) hide show
  1. app.py +7 -18
  2. requirements.txt +0 -1
app.py CHANGED
@@ -1,7 +1,6 @@
1
  from fastapi import FastAPI
2
  import pandas as pd
3
  import os
4
- import requests
5
  from deta import Deta
6
  from fastapi.responses import StreamingResponse, FileResponse
7
  from io import BytesIO
@@ -12,13 +11,13 @@ app = FastAPI()
12
 
13
  # load deta using
14
 
15
- # app.add_middleware(
16
- # CORSMiddleware,
17
- # allow_origins=["*"],
18
- # allow_credentials=True,
19
- # allow_methods=["*"],
20
- # allow_headers=["*"],
21
- # )
22
 
23
  @app.get("/files")
24
  async def get_files(exchange: str = "US"):
@@ -53,13 +52,3 @@ async def get_file(id: str):
53
  drive = deta.Drive("stonk_events")
54
  res = drive.get(id)
55
  return StreamingResponse(res.iter_chunks(1024), media_type="application/pdf")
56
-
57
-
58
- # app get https://raw.githubusercontent.com/FriendlyUser/chatgpt_prompts/main/README.md
59
- # and return text
60
- @app.get("/chatgpt/README")
61
- async def get_readme():
62
- # requests get data from url
63
- readMe = requests.get("https://raw.githubusercontent.com/FriendlyUser/chatgpt_prompts/main/README.md")
64
- # return text
65
- return readMe.text
 
1
  from fastapi import FastAPI
2
  import pandas as pd
3
  import os
 
4
  from deta import Deta
5
  from fastapi.responses import StreamingResponse, FileResponse
6
  from io import BytesIO
 
11
 
12
  # load deta using
13
 
14
+ app.add_middleware(
15
+ CORSMiddleware,
16
+ allow_origins=["*"],
17
+ allow_credentials=True,
18
+ allow_methods=["*"],
19
+ allow_headers=["*"],
20
+ )
21
 
22
  @app.get("/files")
23
  async def get_files(exchange: str = "US"):
 
52
  drive = deta.Drive("stonk_events")
53
  res = drive.get(id)
54
  return StreamingResponse(res.iter_chunks(1024), media_type="application/pdf")
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,4 +1,3 @@
1
  fastapi
2
  pandas
3
  deta
4
- requests
 
1
  fastapi
2
  pandas
3
  deta