1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00
examples/shutdown-server
2022-12-11 15:25:57 +00:00
..
src chore: remove fluent crate override 2022-08-28 18:43:05 +01:00
Cargo.toml update env_logger to 0.10 2022-12-11 15:25:57 +00:00
README.md use placeholder approach to shutdown-server 2022-08-07 23:58:56 +01:00

shutdown-server

Demonstrates how to shutdown the web server in a couple of ways:

  1. remotely, via HTTP request
  2. sending a SIGINT signal to the server (control-c)

Usage

Running The Server

$ cd shutdown-server
$ cargo run --bin shutdown-server
[INFO] starting HTTP server at http://localhost:8080
[INFO] Starting 2 workers
[INFO] Actix runtime found; starting in Actix runtime

Available Routes

  • GET /hello
    • Test hello world
  • POST /stop/true
    • Gracefully shuts down the server and exit
  • POST /stop/false
    • Forces server shutdown and exits