maaviaasghar4/rest-api-with-rust-and-actix

REST-API-with-Rust-and-Actix

This is a simple REST API developed using RUST Actix

.

Here is the link to the tutorial

Setup diesel

Setup postgres

API design

Our REST API needs to have three endpoints :

  • /tweets
  GET: list last 50 tweets
  POST: create a new tweet
  • /tweets/:id
  GET: find a tweet by its ID
  DELETE: delete a tweet by its ID
  • /tweets/:id/likes
  GET: list all likes attached to a tweet
  POST: add +1 like to a tweet
  DELETE: add -1 like to a tweet

Curl API to test API endpoints

# list tweets
curl http://localhost:8000/tweets

# get a tweet (return status code: 204 because there is no tweet)
curl http://localhost:8000/tweets/abc

# create a tweet
curl -X POST -d '{"message": "This is a tweet"}' -H "Content-type: application/json" http://localhost:8000/tweets

# delete a tweet (return status code: 204 in any case)
curl -X DELETE http://localhost:8000/tweets/abc

# list likes from a tweet
curl http://localhost:8000/tweets/abc/likes

# add one like to a tweet
curl -X POST http://localhost:8000/tweets/abc/likes

# remove one like to a tweet
curl -X DELETE http://localhost:8000/tweets/abc/likes

Information - Updated Jul 28, 2022

Stars: 0
Forks: 0
Issues: 0

Rust bindings for the FLTK Graphical User Interface library

The fltk crate is a crossplatform lightweight gui library which can be statically linked to produce small, self-contained and fast gui applications

Rust bindings for the FLTK Graphical User Interface library

A cross platform Rust library for efficiently walking a directory recursively

Comes with support for following symbolic links, controlling the number of

A cross platform Rust library for efficiently walking a directory recursively

Rust bindings to libmupen64plus

Doesn't perform linking as mupen64plus is a shared library

Rust bindings to libmupen64plus

dynamic-link-library

Dynamic-link-library template for Rust

dynamic-link-library

This is a linked list implementation in Rust with some bells and whistles made for...

This is a linked list implementation in Rust with some bells and whistles made for training purposes:

This is a linked list implementation in Rust with some bells and whistles made for...

Audio compression written in pure rust

It Doesn't link to any bindings so its buildable for wasm32-unknown-unknown

Audio compression written in pure rust

MongoDB and Rust Basic

Follow this link for editing permission for user

MongoDB and Rust Basic

Helpful Links for Rust

Official language guide Online documentation of all crates

Helpful Links for Rust

Shorter is a simple link shortener service written in Rust built on

Shorter is a simple link shortener service written in Cloudflare Workers with authentication provided by

Shorter is a simple link shortener service written in Rust built on

A Rust GameBoy emulator!

TetrisZelda: Link's Awakening

A Rust GameBoy emulator!

Demo how to build rust application for router with mipsel CPU (MT7621)

Demo how to link libcurl built with uclibc lib

Demo how to build rust application for router with mipsel CPU (MT7621)

Оригинальный репозитарий

While the Linkerd2 proxy is heavily influenced by Rust programming language

Оригинальный репозитарий
Facebook Instagram Twitter GitHub Dribbble
Privacy