feat: add simple_on_shutdown crate and update dependencies
This commit is contained in:
parent
42050c3315
commit
45c1aa471a
7
Cargo.lock
generated
7
Cargo.lock
generated
@ -899,6 +899,7 @@ dependencies = [
|
||||
"env_logger",
|
||||
"log",
|
||||
"serde",
|
||||
"simple_on_shutdown",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@ -982,6 +983,12 @@ dependencies = [
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "simple_on_shutdown"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "08df66e765f42432e83ef29ba9f45c5d80bfda7d5139baee77954829040ac6e2"
|
||||
|
||||
[[package]]
|
||||
name = "slab"
|
||||
version = "0.4.9"
|
||||
|
@ -13,3 +13,4 @@ actix-web = "4"
|
||||
env_logger = "0.10.0"
|
||||
log = "0.4.19"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
simple_on_shutdown = "1.0.0"
|
||||
|
@ -6,6 +6,11 @@
|
||||
This project is a simple implementation of a search engine in Rust. It uses the BM25 algorithm for ranking documents.
|
||||
This project is a learning exercise and is not intended for production use.
|
||||
|
||||
## Todo
|
||||
|
||||
- [] Store index to Disk
|
||||
- [] Save multiple indecies
|
||||
|
||||
### Features
|
||||
|
||||
- Indexing documents: The search engine maintains an index of documents, where each document is associated with a unique identifier.
|
||||
|
@ -24,12 +24,10 @@ async fn main() -> std::io::Result<()> {
|
||||
App::new()
|
||||
// Inject the search engine into the application state
|
||||
.app_data(app_state.clone())
|
||||
|
||||
// enable logger
|
||||
.wrap(Logger::default())
|
||||
|
||||
// Hello Routes
|
||||
.service(hello::say_hello)
|
||||
|
||||
// Search Routes
|
||||
.route(
|
||||
"/search/index/document",
|
||||
@ -42,7 +40,7 @@ async fn main() -> std::io::Result<()> {
|
||||
.route("/search", web::get().to(search::search))
|
||||
.route("/search/debug", web::get().to(search::debug_index))
|
||||
})
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.bind(("127.0.0.1", 4000))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user