mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-11 00:46:38 +01:00
Add console logs to search module
This commit is contained in:
parent
56710fee39
commit
f2cc66d414
@ -34,6 +34,8 @@ router.post('/serpapi', jsonParser, async (request, response) => {
|
||||
const { query } = request.body;
|
||||
const result = await fetch(`https://serpapi.com/search.json?q=${encodeURIComponent(query)}&api_key=${key}`);
|
||||
|
||||
console.log('SerpApi query', query);
|
||||
|
||||
if (!result.ok) {
|
||||
const text = await result.text();
|
||||
console.log('SerpApi request failed', result.statusText, text);
|
||||
@ -143,6 +145,8 @@ router.post('/searxng', jsonParser, async (request, response) => {
|
||||
return response.sendStatus(400);
|
||||
}
|
||||
|
||||
console.log('SearXNG query', baseUrl, query);
|
||||
|
||||
const url = new URL(baseUrl);
|
||||
const params = new URLSearchParams();
|
||||
params.append('q', query);
|
||||
@ -205,6 +209,8 @@ router.post('/visit', jsonParser, async (request, response) => {
|
||||
return response.sendStatus(400);
|
||||
}
|
||||
|
||||
console.log('Visiting web URL', url);
|
||||
|
||||
const result = await fetch(url, { headers: visitHeaders });
|
||||
|
||||
if (!result.ok) {
|
||||
|
Loading…
Reference in New Issue
Block a user