1
0
mirror of https://github.com/actix/examples synced 2024-11-23 14:31:07 +01:00

git push fix basics

This commit is contained in:
krircc 2018-04-15 10:45:30 +08:00
commit c0ddc4bd9d
3 changed files with 2 additions and 3 deletions

View File

@ -16,6 +16,7 @@ cargo run
- [http://localhost:8080/async/bob](http://localhost:8080/async/bob)
- [http://localhost:8080/user/bob/](http://localhost:8080/user/bob/) plain/text download
- [http://localhost:8080/test](http://localhost:8080/test) (return status switch GET or POST or other)
- [http://localhost:8080/favicon](http://localhost:8080/static/favicon.htmicol)
- [http://localhost:8080/welcome](http://localhost:8080/static/welcome.html)
- [http://localhost:8080/notexit](http://localhost:8080/static/404.html) display 404 page
- [http://localhost:8080/error](http://localhost:8080/error) Panic after request

View File

@ -98,7 +98,6 @@ fn main() {
// async handler
.resource("/async/{name}", |r| r.method(Method::GET).a(index_async))
.resource("/test", |r| r.f(|req| {
println!("=============test=============");
match *req.method() {
Method::GET => HttpResponse::Ok(),
Method::POST => HttpResponse::MethodNotAllowed(),
@ -106,7 +105,6 @@ fn main() {
}
}))
.resource("/error", |r| r.f(|req| {
println!("=============error=============");
error::InternalError::new(
io::Error::new(io::ErrorKind::Other, "test"), StatusCode::OK)
}))

View File

@ -87,4 +87,4 @@
<input id="send" type="button" value="Send" />
</form>
</body>
</html>
</html>