fanhaipeng0403/rust_api

REST API with Rust using Actix-Web 2

GET /users ➡ returns all users

.0

API Endpoints:
  • 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
Crates Used
  • 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

Dependencies

Install Diesel CLI:
  • Click here for reference on how to install diesel_cli
cargo install diesel_cli

How To Use

  • 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

Information - Updated Oct 23, 2021

Stars: 0
Forks: 0
Issues: 0

Rust implementation of Weighted Finite States Transducers

Rustfst is a library for constructing, combining, optimizing, and searching weighted

Rust implementation of Weighted Finite States Transducers

Rust Playground for MacOS

status: experimental / pre-release / guaranteed buggy

Rust Playground for MacOS

Gather statistics of steam games from steamcharts in your terminal

STEAMAT is a powerful client written in Rust which uses ureq libraries to collect and parse data from

Gather statistics of steam games from steamcharts in your terminal

A process viewer GUI in rust

It provides current status of your processes (cpu and memory usage) and your system (usage of every core and of your RAM, and the temperature...

A process viewer GUI in rust

A minimal command line text editor written in Rust

Development status: The cell editor project is something I made in my free

A minimal command line text editor written in Rust

Demo used in Rust Intro presentation for Near Web Series, adapted from example on near

This smart contract saves and records the status messages of NEAR accounts that call it

Demo used in Rust Intro presentation for Near Web Series, adapted from example on near

The StatsD server written in Rust

Bioyino is a distributed statsd-protocol server with carbon backend

The StatsD server written in Rust

rs-crisp-status-reporter

Crisp Status Reporter for Rust

rs-crisp-status-reporter

Attractor is a program to search for and generate two dimensional quadratic map strange

Status: experimental, for me as an exercise in Rust

Attractor is a program to search for and generate two dimensional quadratic map strange
Facebook Instagram Twitter GitHub Dribbble
Privacy