Remove unused Searxng tester script and update auth middleware (removed).
The Searxng tester script was deleted as it was unused and unnecessary. Commented out the auth middleware route layer in `src/routes.rs` to simplify the implementation while leaving a note for possible future customization.
This commit is contained in:
@@ -1,29 +0,0 @@
|
|||||||
import { SearxngService, type SearxngServiceConfig, type SearxngSearchResult } from 'searxng';
|
|
||||||
|
|
||||||
const config: SearxngServiceConfig = {
|
|
||||||
baseURL: 'https://search-engine-gsio.fly.dev',
|
|
||||||
defaultSearchParams: {
|
|
||||||
format: 'json',
|
|
||||||
lang: 'auto',
|
|
||||||
},
|
|
||||||
defaultRequestHeaders: {
|
|
||||||
'Content-Type': 'application/json',
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
const searxngService = new SearxngService(config);
|
|
||||||
|
|
||||||
async function performSearch(query) {
|
|
||||||
try {
|
|
||||||
const results = await searxngService.search(query);
|
|
||||||
console.log(results);
|
|
||||||
return results;
|
|
||||||
} catch (error) {
|
|
||||||
console.error('Search failed:', error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const results = await performSearch('dogs');
|
|
||||||
|
|
||||||
console.log(JSON.stringify(results));
|
|
@@ -47,7 +47,7 @@ pub fn create_router() -> Router {
|
|||||||
.route("/api/webhooks", post(handle_webhooks_post))
|
.route("/api/webhooks", post(handle_webhooks_post))
|
||||||
// consume a stream resource
|
// consume a stream resource
|
||||||
.route("/webhooks/:stream_id", get(handle_webhooks))
|
.route("/webhooks/:stream_id", get(handle_webhooks))
|
||||||
.route_layer(axum::middleware::from_fn(auth))
|
// .route_layer(axum::middleware::from_fn(auth)) // uncomment to implement your own auth
|
||||||
.route("/health", get(health))
|
.route("/health", get(health))
|
||||||
.layer(
|
.layer(
|
||||||
TraceLayer::new_for_http()
|
TraceLayer::new_for_http()
|
||||||
|
Reference in New Issue
Block a user