parent
d8e31033fc
commit
01557ca5ec
@ -0,0 +1,31 @@
|
|||||||
|
use axum::{
|
||||||
|
routing::{get, post},
|
||||||
|
Router,
|
||||||
|
};
|
||||||
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
|
mod index;
|
||||||
|
use index::SearchEngine;
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let app = Router::new()
|
||||||
|
.route("/search", get(search))
|
||||||
|
.route("/index", post(index_file));
|
||||||
|
|
||||||
|
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
||||||
|
println!("Server running on http://{}", addr);
|
||||||
|
|
||||||
|
axum::Server::bind(&addr)
|
||||||
|
.serve(app.into_make_service())
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn search() {
|
||||||
|
// TODO: 实现搜索处理
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn index_file() {
|
||||||
|
// TODO: 实现文件索引
|
||||||
|
}
|
Loading…
Reference in new issue