Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions webapi/api/endpoints/v1/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@

router = APIRouter()

# curl -X POST "http://localhost:8000/login?username=lfponcen&password=lfponcen" -v <-- to get the session_token thru the cookie
# curl -b session_token=(gotten from verbose) -X GET "http://localhost:8000"
@router.get("", response_model=list[User])
def read_users(phone: Optional[int] = None, skip: int = 0, limit: int = 10,
session: Session = Depends(get_session),
Expand Down
1 change: 0 additions & 1 deletion webapi/auth/auth_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def create_access_token(data: dict, expires_delta: Optional[timedelta] = None):
return encoded_jwt


# Crear un token
def crear_jwt(data: dict):
payload = {
"exp": datetime.utcnow() + timedelta(hours=1),
Expand Down
4 changes: 2 additions & 2 deletions webapi/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

# MariaDB server
# Ensure that the environment variable DB_URL is set to your MariaDB connection string
# Example: export DB_URL="mariadb+mariadbconnector://user:psw@127.0.0.1:3306/bank_db"
# Example: export DB_URL="mariadb+mariadbconnector://user:psw@127.0.0.1:3306/crud_data_stored"

DB_URL = os.getenv("DB_URL")
if not DB_URL:
DB_URL = "sqlite:///./bank_db.db" # Default to SQLite if no environment variable is set
DB_URL = "sqlite:///./crud_data_stored.db" # Default to SQLite if no environment variable is set
5 changes: 0 additions & 5 deletions webapi/db/redis_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

from core import config

# docker run -d \
# --name redis-server \
# -p 6379:6379 \
# redis/redis-stack:latest


def get_redis():
redis = Redis(
Expand Down
16 changes: 0 additions & 16 deletions webapi/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,6 @@
openapi_tags=tags_metadata
)

"""
Create a MariaDB container for testing purposes.
You can run this command in your terminal to start a MariaDB server with the specified environment variables
and port mapping. Make sure Docker is installed and running on your machine.
docker run --detach \
--env MARIADB_USER=pbtest \
--env MARIADB_PASSWORD=pbtest \
--env MARIADB_DATABASE=bank_db \
--env MARIADB_RANDOM_ROOT_PASSWORD=1 \
--name mariadb-server-test \
-p 3306:3306 \
mariadb:latest

Ensure that the environment variable DB_URL is set to your MariaDB connection string
Example: export DB_URL="mariadb+mariadbconnector://pbtest:pbtest@127.0.0.1:3306/bank_db"
"""

@myapp.get("/")
def root():
Expand Down
1 change: 0 additions & 1 deletion webapi/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# models/__init__.py
from .user import User
from .prompts import Prompts

Expand Down