changes include: allow GET endpoints, redirect to codey.lol instead of returning status 422, clean junk from ai endpoint, add misc endpoint, add methods to lyric_search_new.sources.cache, other misc/cleanup
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
import logging
|
||||
import traceback
|
||||
import regex
|
||||
import json
|
||||
|
||||
from aiohttp import ClientSession, ClientTimeout
|
||||
from fastapi import FastAPI, Request, HTTPException, BackgroundTasks
|
||||
@@ -49,7 +50,8 @@ class AI(FastAPI):
|
||||
}
|
||||
|
||||
for endpoint, handler in self.endpoints.items():
|
||||
app.add_api_route(f"/{endpoint}/", handler, methods=["POST"])
|
||||
app.add_api_route(f"/{endpoint}/", handler, methods=["POST"] if not endpoint == "testy" else ["POST", "GET"])
|
||||
|
||||
|
||||
async def respond_via_webhook(self, data: ValidHookSongRequest, originalRequest: Request):
|
||||
"""Respond via Webhook"""
|
||||
|
||||
Reference in New Issue
Block a user