Skip to content

Commit

Permalink
Merge pull request #14 from soilwise-he/initial_per_url
Browse files Browse the repository at this point in the history
initial implementation of results by url
  • Loading branch information
vgole001 committed Jun 7, 2024
2 parents fefd6ed + e340876 commit 3c9131e
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 3c9131e

Please sign in to comment.