- GET /users ➡ returns all users
- POST /users ➡ takes in a JSON payload and creates a new user based on it
- PUT /users ➡ takes in a JSON payload and updates the user
- GET /users/{id} ➡ returns the user with a given id
- DELETE /users/{id} ➡ deletes the user with a given id
- POST /register ➡ takes in a JSON payload and creates a new user based on it
- POST /auth ➡ takes in a JSON payload for login
- DELETE /auth ➡ for logout
- Get /auth ➡ returns the user data if we are signed in and a status 401 if we are not
- actix-redis
- actix-rt
- actix-session
- actix-web
- chrono
- derive_more
- diesel
- diesel_migrations
- dotenv
- env_logger
- lazy_static
- log
- rand
- rust-argon2
- serde
- serde_derive
- serde_json
- uuid
- Click here for reference on how to install diesel_cli
cargo install diesel_cli
- clone repository
git clone https://github.com/dansoy/rust-api project-name
- cd into your project
cd project-name
- create a copy of your .env file
cp .env.example .env
- create an empty Mysql database and add your database details to the .env file
DB_HOST=
DB_PORT=
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
- run server
cargo run