Crates.io | example-webserver-rs |
lib.rs | example-webserver-rs |
version | 0.1.1 |
source | src |
created_at | 2024-09-06 16:30:58.096251 |
updated_at | 2024-09-10 08:10:17.813068 |
description | Building Rust webserver application with Axum for fun |
homepage | |
repository | https://github.com/rpietrusinski/example-webserver-rs |
max_upload_size | |
id | 1366133 |
size | 44,995 |
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.
From this project one can learn the following concepts:
Command cargo run
will build the project and start the webserver on port 3000
. Below are the commands you can
execute against webserver.
curl -X GET 127.0.0.1:3000
curl -X GET 127.0.0.1:3000/json
curl -X GET 127.0.0.1:3000/json-counter
curl \
-X POST 127.0.0.1:3000/append \
-H "Content-Type: application/json" \
-d '{"data": "hello"}'
curl -X GET 127.0.0.1:3000/rnd
curl -X GET "127.0.0.1:3000/country?name=usa"