migeruj / task-api

This is a basic todo's rocket api with persistence using diesel for mysql databases

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Install Rust - Nightly Version

  1. Install rustup. You can use the following command for UNIX / Ubuntu / WSL

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  2. Rust nightly as your default toolchain by running the command:

    rustup default nightly
  3. Enjoy 🚀

Database configuration

Install Diesel

Diesel is the best ORM currently in Rust. Check the page for code examples and overviews
  1. For Ubuntu/Debian Install libmysqlclient-dev package, for windows install mysql-client binaries.
    apt install libmysqlclient-dev
  2. Config DATABASE_URL environment variable with your mysql URI database location URI Example
  3. Execute
    cargo install diesel_cli --no-default-features --features mysql

Run

  1. Execute diesel migration run for execute migrations to create the project database
  2. Execute cargo run at cargo.toml level.
  3. Now you can use the api at http://localhost:8000

Tests

About

This is a basic todo's rocket api with persistence using diesel for mysql databases

License:GNU General Public License v3.0


Languages

Language:Rust 100.0%