#[ntex::main]
async fn main() -> std::io::Result<()> {
let _ = database::setup::setup();
start_polling();
web::HttpServer::new(|| {
web::App::new()
.service(hello)
.service(
// Setting up a scope for all keys-related routes
web::scope("/api/v1/keys")
.configure(controllers::keys::config) // Utilizing the configuration from controllers::keys
)
.service(
// Setting up a scope for all keys-related routes
web::scope("/api/v1/admins")
.configure(controllers::admins::config) // Utilizing the configuration from controllers::keys
)
})
.bind("0.0.0.0:5000")?
.run()
.await
}
Doing ctrl+c results in:
^Cthread 'ntex-server signals' panicked at /home/starkbamse/.cargo/registry/src/index.crates.io-6f17d22bba15001f/ntex-rt-0.4.12/src/system.rs:59:21:
System is not running
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Doing ctrl+c results in:
How can we shut down a server without panic?