Skip to content

Commit

Permalink
updated api folder
Browse files Browse the repository at this point in the history
  • Loading branch information
ajits-github committed Aug 21, 2023
1 parent b161295 commit 776d223
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ RUN pip install --trusted-host pypi.python.org -r requirements.txt
COPY api .
COPY config_util.py .
COPY config.yml .
COPY .env .

# Specify the command to run on container start
CMD ["uvicorn", "api_server:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
7 changes: 6 additions & 1 deletion api/api_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@


DB_PATH = config['database']['path']
app = FastAPI()
app = FastAPI(
title="Parts Catalog API",
description="An API to fetch and manage data related to various machine parts scraped from different manufacturers. \
It provides endpoints to query parts based on manufacturer, category, model, and other related fields.",
version="1.0.0"
)

def query_database(query, params=()):
with sqlite3.connect(DB_PATH) as conn:
Expand Down
2 changes: 2 additions & 0 deletions api/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
fastapi==0.68.0
uvicorn==0.15.0
pyyaml==6.0.1
azure-storage-blob==12.8.1
python-dotenv
# sqlite3==0.0.1

0 comments on commit 776d223

Please sign in to comment.