You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
625 B
31 lines
625 B
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: 实现文件索引
|
|
}
|