mirror of
https://github.com/ReVanced/revanced-api.git
synced 2026-01-24 11:41:03 +00:00
refactor: move versioning efforts to initalization
This commit is contained in:
committed by
Alexandre Teles (afterSt0rm)
parent
8d36663610
commit
42c88290b1
32
api/connections.py
Normal file
32
api/connections.py
Normal file
@@ -0,0 +1,32 @@
|
||||
"""
|
||||
This module provides a blueprint for the connections endpoint.
|
||||
|
||||
Routes:
|
||||
- GET /connections: Get ReVanced connection links.
|
||||
"""
|
||||
|
||||
import os
|
||||
from sanic import Blueprint, Request
|
||||
from sanic.response import JSONResponse, json
|
||||
from sanic_ext import openapi
|
||||
|
||||
from api.models.socials import ConnectionsResponseModel
|
||||
from config import social_links
|
||||
|
||||
connections: Blueprint = Blueprint(os.path.basename(__file__).strip(".py"))
|
||||
|
||||
|
||||
@connections.get("/connections")
|
||||
@openapi.definition(
|
||||
summary="Get ReVanced connection links",
|
||||
response=[ConnectionsResponseModel],
|
||||
)
|
||||
async def root(request: Request) -> JSONResponse:
|
||||
"""
|
||||
Returns a JSONResponse with a dictionary containing ReVanced connection links.
|
||||
|
||||
**Returns:**
|
||||
- JSONResponse: A Sanic JSONResponse instance containing a dictionary with the connection links.
|
||||
"""
|
||||
data: dict[str, dict] = {"connections": social_links}
|
||||
return json(data, status=200)
|
||||
Reference in New Issue
Block a user