You've already forked AstralRinth
forked from didirus/AstralRinth
3c2f144795
* Move v2 routes to v2 module * Remove v1 routes and make it run * Make config declaration consistent, add v3 module * Readd API v1 msgs * Fix imports
14 lines
345 B
Rust
14 lines
345 B
Rust
pub use super::ApiError;
|
|
use actix_web::{web, HttpResponse};
|
|
use serde_json::json;
|
|
|
|
pub fn config(cfg: &mut web::ServiceConfig) {
|
|
cfg.service(web::scope("v3").route("", web::get().to(hello_world)));
|
|
}
|
|
|
|
pub async fn hello_world() -> Result<HttpResponse, ApiError> {
|
|
Ok(HttpResponse::Ok().json(json!({
|
|
"hello": "world",
|
|
})))
|
|
}
|