mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-06-07 05:17:48 +02:00
22 lines
424 B
Rust
22 lines
424 B
Rust
use crate::Data;
|
|
use actix_web::{web, get};
|
|
use serde::Serialize;
|
|
|
|
|
|
#[derive(Default, Serialize)]
|
|
pub struct KeysResponse {
|
|
private: Option<String>,
|
|
public: Option<String>,
|
|
}
|
|
|
|
#[get("/keys")]
|
|
pub async fn list(
|
|
data: web::Data<Data>,
|
|
) -> web::Json<KeysResponse> {
|
|
let api_keys = data.api_keys.clone();
|
|
web::Json(KeysResponse{
|
|
private: api_keys.private,
|
|
public: api_keys.public,
|
|
})
|
|
}
|