sankaku / sample_actix_with_redis

Usage sample for redis crates with actix-web.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sample_actix_with_redis

Usage sample for redis crates below with actix-web.

Requirements

  • cargo
  • docker-compose

Run

docker-compose up -d

cd app
cargo run

# to stop...

# Press Ctrl-C
# and
cd ../
docker-compose down

Endpoints

All endpoints accept HTTP GET method.

uuid in /foo/{uuid} is the string you'll get as the response of /foo.

  • /direct
  • /direct/{uuid}
  • /with_r2d2
  • /with_r2d2/{uuid}
  • /bb8
  • /bb8/{uuid}
  • /deadpool
  • /deadpool/{uuid}
  • /mobc
  • /mobc/{uuid}
  • /alt_r2d2
  • /alt_r2d2/{uuid}

Example

$ curl localhost:8080/direct
e5aa716d-e647-484a-ad91-8864f20380b1 # no newline here actually
$ curl localhost:8080/direct/e5aa716d-e647-484a-ad91-8864f20380b1
hi # no newline here actually

License

MIT

About

Usage sample for redis crates with actix-web.

License:MIT License


Languages

Language:Rust 100.0%