1
0
mirror of https://github.com/actix/examples synced 2024-12-02 18:02:22 +01:00
examples/self-shutdown-route/README.md

25 lines
654 B
Markdown
Raw Normal View History

2020-01-26 00:49:19 +01:00
# self-shutdown-route
> Demonstrates how to shutdown the web server using a route hosted by the server itself using channels.
This technique can be easily modified to support shutting down the server using other kinds of external events.
Created in response to actix/actix-web#1315.
## Usage
### Running The Server
```bash
cargo run --bin self-shutdown-route
# 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)
- Regular hello world route
- [POST /stop](http://localhost:8080/stop)
- Calling this will shutdown the server and exit