2020-01-31 07:10:56 -05:00
|
|
|
# shutdown-server
|
2020-01-25 23:49:19 +00:00
|
|
|
|
2020-01-31 07:10:56 -05:00
|
|
|
Demonstrates how to shutdown the web server in a couple of ways:
|
|
|
|
|
|
|
|
1. remotely, via http request
|
2022-02-06 08:13:24 +00:00
|
|
|
- Created in response to actix/actix-web#1315
|
|
|
|
1. sending a SIGINT signal to the server (control-c)
|
|
|
|
- actix-server natively supports SIGINT
|
2020-01-25 23:49:19 +00:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
### Running The Server
|
|
|
|
|
2022-02-18 03:36:04 +00:00
|
|
|
```sh
|
2021-10-06 17:28:53 -04:00
|
|
|
cd basics/shutdown-server
|
2020-01-31 07:10:56 -05:00
|
|
|
cargo run --bin shutdown-server
|
2020-01-25 23:49:19 +00:00
|
|
|
|
|
|
|
# Starting 8 workers
|
|
|
|
# Starting "actix-web-service-127.0.0.1:8080" service on 127.0.0.1:8080
|
|
|
|
```
|
|
|
|
|
|
|
|
### Available Routes
|
|
|
|
|
|
|
|
- [GET /hello](http://localhost:8080/hello)
|
2022-02-06 08:13:24 +00:00
|
|
|
- Regular hello world route
|
2020-01-25 23:49:19 +00:00
|
|
|
- [POST /stop](http://localhost:8080/stop)
|
2022-02-06 08:13:24 +00:00
|
|
|
- Calling this will shutdown the server and exit
|