Skip to content

Commit

Permalink
initial implementation of results by url
Browse files Browse the repository at this point in the history
  • Loading branch information
pvgenuchten committed May 31, 2024
1 parent 63ec572 commit e340876
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from databases import Database
from typing import List
from pydantic import BaseModel
from urllib.parse import unquote
import asyncpg
import os

Expand Down Expand Up @@ -89,6 +90,13 @@ async def get_non_empty_warnings():
data = await fetch_data(query=query)
return data

# Endpoint to retrieve data with client error statuses
@app.get('/status/{item:path}', response_model=List[StatusResponse])
async def get_status_for_url(item):
query = "SELECT * FROM linkchecker_output WHERE urlname = :item"
data = await fetch_data(query=query, values={'item': item })
return data

# Start the application
@app.on_event('startup')
async def startup():
Expand Down

0 comments on commit e340876

Please sign in to comment.