You've already forked AstralRinth
forked from didirus/AstralRinth
Perses finale (#558)
* 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
This commit is contained in:
13
src/routes/v3/mod.rs
Normal file
13
src/routes/v3/mod.rs
Normal file
@@ -0,0 +1,13 @@
|
||||
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",
|
||||
})))
|
||||
}
|
||||
Reference in New Issue
Block a user