Giter Site home page Giter Site logo

restful-rust's Introduction

RESTful Rust

Build Status

RESTful Rust is straightforward REST API example written in Rust. It shows how to implement and test GET, POST, PUT and DELETE methods with amazing Warp web server framework.

Getting started

To run the project locally:

  1. install rustup by following the instructions
  2. add clippy (collection of lints) and rustfmt (code formatter) by running rustup component add clippy and rustup component add rustfmt accordingly
  3. clone this repository git clone https://github.com/blurbyte/restful-rust.git
  4. to start an API enter project's directory and run cargo run
  5. run tests with cargo test
  6. lint code with cargo clippy and format it with cargo fmt
  7. run cargo build --release command to generate single optimized binary

Dependencies overview

Dependency Description
warp Composable web server framework with powerful filters system
serde Library for serializing and deserializing data structures
chrono Date and time utilities
log + pretty_env_logger Simple logger (by default enabled in debug mode)

Available endpoints

List of API routes with associated REST verbs:

Testing RESTful API

Nowadays there are many great tools which make testing API easy, such as Postman or Insomnia.

Just enter one of the available endpoints with appropriate HTTP method selected:

Testing POST method with Insomnia REST client

And watch a console / terminal for detailed logs:

Terminal logs after each HTTP request

restful-rust's People

Contributors

blurbyte avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.