This is a project aimed at creating a simple CRUD for users in Rust using the Actix framework.
-
main.rs
: This is the main file to start the Actix server. -
test/
: In this folder, you'll find the test script using Curl to verify the API's functionality. -
modules/
: This directory contains route/operations folders for the CRUD.
You can acces the API deploy link Here.
-
Make sure you have Rust installed on your machine.
-
Clone this repository.
-
Navigate to the project folder.
Then proceed to one of the 3 environments.
If your API still won't work, changing the Host bind address from '0.0.0.0'
to '127.0.0.1'
may resolve the problem.
-
Run
cargo run
to start the Actix server. -
Use the test script in
test/
to check the API's functionality.
-
Run
cargo build --release
-
Run
./target/release/actix-basic-api
to initialize the API.
To use the Docker Image you must change the Host API address to work properly.
-
Build the docker image with
docker build -t actix-basic-api .
-
Run the container with
docker run -p 8080:8080 actix-basic-api
And it's done!