This is a simple demo project showcasing how to build APIs using Rust and Axum framework.
- Install Rust: https://www.rust-lang.org/tools/install
- Clone the repository:
git clone https://github.com/gianalarcon/demo-rust-axum.git
- Navigate to the project directory:
cd demo-rust-axum
- Install dependencies:
cargo build
Copy the .env.example
file to .env
and set the value of the TEXT
environment variable.
cp .env.example .env
To start the server, run the following command:
cargo run
The server will start running on http://localhost:3000
.
GET /read-env
: Reads the value of theTEXT
environment variable.
Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.
This project is licensed under the MIT License.