Skip to content

Powdee/actix-auth-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

actix-rust-OAuth

Rust has picked up a lot of momentum since we last looked at it in 2015. Companies like Amazon and Microsoft have adopted it for a growing number of use cases. Microsoft, for example, sponsors the Actix project on GitHub, which is a general purpose open source actor framework based on Rust. The Actix project also maintains a RESTful API development framework, which is widely regarded as a fast and performant web framework. Although the project was temporarily on hold in early 2020, the project ownership has moved to a new maintainer, and development continues.

I was about to start a new project on Cardano blockchain and we need simple CRUD operations with Database of users and products and create a portal to communicate with Cardano blockchain. This repo is only for creating CRUD operations with basic OAuth. A little showcase how Rust works on actix-web framework.

RESTful API

* GET /users
* GET /users/{id}
* POST /users
* DELETE /users/{id}

Setup

First, have PostgreSQL installed and running.

Make sure you have cargo installed.

Next, run in the terminal:

cargo run

When run has executed successfully, run the API to GET users:

curl -H "Authorization: Bearer $TOKEN" -v 127.0.0.1:8080/users

Or run the API to Create user:

curl -v -H "Content-Type: application/json; Authorization: Bearer $TOKEN"  -X POST -d '{"first_name": "foo1", "last_name": "bar1", "email": "[email protected]"}' 127.0.0.1:8080/users

About

RESTful API on Actix-web on RUST

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published