Build a CRUD REST API with Rust Axum | Tutorial

Поділитися
Вставка
  • Опубліковано 26 лип 2024
  • A tutorial on creating a basic CRUD REST API with Rust, using the Axum framework and Postgres as the database.
    Timestamps
    00:00 Introduction
    00:26 Creating your Postgres user and database.
    01:28 Adding the crates we will make use of in the cargo.toml file.
    02:40 The .env file for environment variables
    02:55 How to get your Postgres database connection string.
    03:23 Import struct, traits, functions, and macros into the program scope.
    04:48 Working with environment variables.
    08:13 Get/Read task API handler.
    10:08 Post/Create task API handler.
    13:15 Patch/Update task API handler.
    15:30 DELETE task API handler.
    17:34 Update task handler Revisited and Redesigned.
    GitHub Repo: github.com/cudidotdev/Rust-ax...
    Further reading
    Axum order of extractors: docs.rs/axum/0.6.20/axum/extr...
    #rust #axum #sql

КОМЕНТАРІ • 18

  • @cudidotdev
    @cudidotdev  5 місяців тому +2

    Thanks for watching! For Rust consultancy services, please visit my website at cudi.dev.
    I appreciate your support. GitHub repo and further reading ↓
    GitHub Repo: github.com/cudidotdev/Rust-axum-postgres-CRUD-app
    Further reading
    Axum order of extractors: docs.rs/axum/0.7.5/axum/extract/index.html#the-order-of-extractors

    • @glepnir522
      @glepnir522 5 місяців тому

      which font you used

    • @cudidotdev
      @cudidotdev  5 місяців тому

      Monaco font

    • @samwilson5544
      @samwilson5544 2 місяці тому

      The order of extractors link is dead

    • @cudidotdev
      @cudidotdev  2 місяці тому

      Thanks for noticing. Here's updated link docs.rs/axum/0.7.5/axum/extract/index.html#the-order-of-extractors

    • @seyeakintunde8225
      @seyeakintunde8225 2 місяці тому

      @@cudidotdev Hi. Which plugin do you use to make your vscode look more like vim?

  • @user-om4mo5yv6i
    @user-om4mo5yv6i 5 місяців тому +7

    Excellent video, this video literally takes a complete beginner, to writing, getting , updating and deleting from a database. Excellent work.

    • @cudidotdev
      @cudidotdev  5 місяців тому

      Great to hear! 💙💙

  • @Mr.BinarySniper
    @Mr.BinarySniper 4 місяці тому +3

    awesome .. and greate channel for rust bigginner.. please do more.. we want more like this.

    • @cudidotdev
      @cudidotdev  4 місяці тому +1

      Thanks. More to come 💙

  • @victorgxn
    @victorgxn 29 днів тому

    More rust tutorial pls

  • @skysea1068
    @skysea1068 5 місяців тому +3

    more like these please..thank you

  • @_travis5957
    @_travis5957 4 місяці тому +2

    Amazing

  • @gusjoagomez
    @gusjoagomez 5 місяців тому +2

    GREAT VIDEO!!!! THANKS!!!!!!!!

  • @meka4996
    @meka4996 2 місяці тому +1

    $ psql -U axum_postgres
    psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "axum_postgres"

    • @cudidotdev
      @cudidotdev  2 місяці тому

      You will have to switch from peer authentication to password. (It's also in the video)
      Here's an article that will help you further.
      medium.com/@syafiqza/configuring-postgresql-authentication-in-linux-from-peer-to-password-1bde0445c4da