diff --git a/.gitignore b/.gitignore index 3de93ab..93abf45 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,8 @@ logs *.log # Python -.venv* +venv* +__pycache__ # Misc .DS_Store @@ -25,6 +26,6 @@ logs .idea # Local env files -.env -.env.* -!.env.example +#.env +#.env.* +#!.env.example diff --git a/server/py/fastapi.py b/server/fastapi_server/fastapi_server.py similarity index 90% rename from server/py/fastapi.py rename to server/fastapi_server/fastapi_server.py index 1658177..808d9d1 100644 --- a/server/py/fastapi.py +++ b/server/fastapi_server/fastapi_server.py @@ -2,6 +2,13 @@ from fastapi import FastAPI, HTTPException from pydantic import BaseModel from typing import Optional import uvicorn +import pymysql + +class mysql_params: + host = "127.0.0.1" + user = "yt2mp3_nuxt" + db = "yt2mp3_nuxt" + pwd = "ultratopsecret,bro" app = FastAPI() @@ -19,6 +26,8 @@ class MeData(BaseModel): profile_picture: Optional[str] = None + + @app.post("/convert") async def convert_endpoint(data: ConversionData): """ @@ -70,4 +79,4 @@ async def me_post_endpoint(data: MeData): if __name__ == "__main__": - uvicorn.run(app, host="0.0.0.0", port=8000) \ No newline at end of file + uvicorn.run(app, host="127.0.0.1", port=8003) \ No newline at end of file diff --git a/server/fastapi_server/requirements.txt b/server/fastapi_server/requirements.txt new file mode 100644 index 0000000..c77ca72 --- /dev/null +++ b/server/fastapi_server/requirements.txt @@ -0,0 +1,14 @@ +annotated-doc==0.0.4 +annotated-types==0.7.0 +anyio==4.12.1 +click==8.3.1 +fastapi==0.128.0 +h11==0.16.0 +idna==3.11 +pydantic==2.12.5 +pydantic_core==2.41.5 +PyMySQL==1.1.2 +starlette==0.50.0 +typing-inspection==0.4.2 +typing_extensions==4.15.0 +uvicorn==0.40.0