example-webserver-rs 0.1.0

Building Rust webserver application with Axum for fun
Documentation

Example-webserver-rs

Project aims for setting up basic webserver functionality written in Rust and providing a few ready-to-use endpoints. It serves for learning purposes and figuring out Rust libraries ecosystem. Implemented with Axum framework.

Implemented

  • Routing
  • GET/POST requests
  • parsing JSON request/response contents
  • FromRequest/IntoResponse traits
  • shared state with Clone trait or Atomic Reference Counting

Examples

  1. GET /
curl -X GET 127.0.0.1:3000
  1. GET /json
curl -X GET 127.0.0.1:3000/json
  1. GET /json-counter
curl -X GET 127.0.0.1:3000/json-counter
  1. POST /append
curl \
    -X POST 127.0.0.1:3000/append \
    -H "Content-Type: application/json" \
    -d '{"data": "hello"}'
  1. GET /rnd
curl -X GET 127.0.0.1:3000/rnd