feat: Add project api route
All checks were successful
Build Docker / BuildImage (push) Successful in 45s

This commit is contained in:
Nathan Woodburn 2025-01-15 22:32:17 +11:00
parent a65896b80d
commit 622a4038ac
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -430,6 +430,39 @@ def email():
return sendEmail(data) return sendEmail(data)
@app.route("/api/v1/project")
def getCurrentProject():
try:
git = requests.get(
"https://git.woodburn.au/api/v1/users/nathanwoodburn/activities/feeds?only-performed-by=true&limit=1",
headers={"Authorization": os.getenv("git_token")},
)
git = git.json()
git = git[0]
repo_name = git["repo"]["name"]
repo_name = repo_name.lower()
repo_description = git["repo"]["description"]
except:
repo_name = "nathanwoodburn.github.io"
repo_description = "Personal website"
git = {
"repo": {
"html_url": "https://nathan.woodburn.au",
"name": "nathanwoodburn.github.io",
"description": "Personal website",
}
}
print("Error getting git data")
return jsonify({
"repo_name": repo_name,
"repo_description": repo_description,
"git": git,
})
#endregion #endregion
# endregion # endregion