You've already forked AstralRinth
forked from didirus/AstralRinth
* refactor: improve error handling * fix: specify bind address instead of port * fix: remove temporary testing file * fix(errors): change error names to snake_case * refactor(errors): split indexing error types, remove unused errors * feat: add env variable checking at program start This just checks whether the enviroment variables exist and can parse to the given type and gives a warning if they can't. This should prevent cases where the program fails at runtime due to checking an environment variable that doesn't exist.
11 lines
327 B
Rust
11 lines
327 B
Rust
use crate::models::mods::SearchRequest;
|
|
use crate::search::{search_for_mod, SearchError};
|
|
use actix_web::{get, web, HttpResponse};
|
|
|
|
#[get("api/v1/mods")]
|
|
pub async fn mod_search(
|
|
web::Query(info): web::Query<SearchRequest>,
|
|
) -> Result<HttpResponse, SearchError> {
|
|
Ok(HttpResponse::Ok().json(search_for_mod(&info)?))
|
|
}
|