Skip to content

Commit

Permalink
minor edits
Browse files Browse the repository at this point in the history
  • Loading branch information
h1-the-swan committed Sep 9, 2024
1 parent 691385e commit 1c76657
Show file tree
Hide file tree
Showing 6 changed files with 1,481 additions and 1,771 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,8 @@ alembic upgrade head

## Code coverage

`pytest --cov=mydiary tests/ --cov-report xml:cov.xml`
`pytest --cov=mydiary tests/ --cov-report xml:cov.xml`

## API codegen

If you change anything in the API (`api.py`), you can update the client (`api.ts`) by running `npm run generateClientAPI`.
13 changes: 13 additions & 0 deletions backend/mydiary/api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
from datetime import datetime
import requests
import io
Expand Down Expand Up @@ -219,6 +220,18 @@ async def lifespan(app: FastAPI):
# return {"message": "Hello World", "root_path": request.scope.get("root_path")}


@app.get("/testhealthcheck", operation_id="testHealthCheck2")
async def testhealthcheck():
return 'hello all good'

@app.get("/db_status", operation_id="dbStatus")
async def db_status():
from .db import sqlite_file_name
return {
'sqlite_file_exists': os.path.exists(sqlite_file_name),
}


@app.get("/gcal/get_auth_url", operation_id="getGCalAuthUrl", response_model=str)
async def get_gcal_auth_url():
from mydiary.googlecalendar_connector import MyDiaryGCal
Expand Down
Loading

0 comments on commit 1c76657

Please sign in to comment.