This is a basic template for a web service built with Actix Web, a powerful, pragmatic, and extremely fast web framework for Rust.
- Actix Web: Utilizes Actix Web for handling server operations, known for its speed and reliability.
- Serde Serialization/Deserialization: Implements Serde for efficient and customizable serialization and deserialization of data.
- Environment Logging: Configured with
pretty_env_logger
andlog
for detailed and formatted logging. - Environment Configuration: Uses
dotenvy
for loading environment variables from a.env
file, making configuration seamless and flexible.
To use this template, you need Rust installed on your system. If Rust isn't installed yet, follow the installation guide on the Rust official website.
To start using this template, clone the repository and navigate into the project directory:
git clone [email protected]:ViniciosLugli/actix-rust-template.git
cd actix-rust-template
Create a .env
file in the root directory of your project to store environment variables:
# Example .env content
RUST_LOG=info
To run the application, use the following command:
cargo run
The server will start on 127.0.0.1:3000
. You can access the application by navigating to http://localhost:3000
in your web browser or using a tool like curl
:
curl http://localhost:3000
This project contains basic tests. Run the tests with:
cargo test