Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(main): add a new endpoint for status #319

Merged
merged 4 commits into from
Apr 24, 2024
Merged
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
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ lock:
build:
poetry export -f requirements.txt --without-hashes --output src/app/requirements.txt
docker build src/. -t pyronear/pyro-api:python3.9-alpine3.14
docker build src/. -t pyronear/pyro-api:latest

# Run the docker
run:
Expand Down
2 changes: 1 addition & 1 deletion src/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ COPY app/requirements.txt /app/requirements.txt

# install dependencies
RUN set -eux \
&& apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev libmagic \
&& apk add --no-cache --virtual .build-deps gcc musl-dev postgresql-dev libmagic curl\
&& pip install --no-cache-dir uv \
&& uv pip install --no-cache --system -r /app/requirements.txt \
&& apk del --purge gcc musl-dev postgresql-dev \
Expand Down
9 changes: 9 additions & 0 deletions src/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@
await database.disconnect()


@app.get("/status")
async def get_api_status():
"""
Returns the status of the API
"""
# TODO : implement a more complex behavior to check if everything is initialized for example
return {"status": "API is running smoothly"}

Check warning on line 70 in src/app/main.py

View check run for this annotation

Codecov / codecov/patch

src/app/main.py#L70

Added line #L70 was not covered by tests


# Routing
app.include_router(login.router, prefix="/login", tags=["login"])
app.include_router(users.router, prefix="/users", tags=["users"])
Expand Down
Loading