You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rohan Sircar
95e5c47c69
|
преди 3 години | |
---|---|---|
.github/workflows | преди 3 години | |
db | преди 3 години | |
migrations/2020-05-02-115427_create_users | преди 4 години | |
src | преди 3 години | |
static | преди 3 години | |
tests/integration | преди 3 години | |
.drone.yml | преди 3 години | |
.env | преди 3 години | |
.gitignore | преди 3 години | |
Cargo.lock | преди 3 години | |
Cargo.toml | преди 3 години | |
LICENSE | преди 3 години | |
Makefile.toml | преди 3 години | |
README.md | преди 3 години | |
build.Dockerfile | преди 3 години | |
build.Dockerfile.dockerignore | преди 3 години | |
build.rs | преди 3 години | |
ci.Dockerfile | преди 3 години | |
ci.Dockerfile.dockerignore | преди 3 години | |
diesel.toml | преди 4 години | |
rustfmt.toml | преди 4 години |
README.md
Testing out the Rust framework Actix-Web to create a JSON API CRUD Web App.
API Demo
Get Users
curl -X GET http://localhost:7800/api/users
{
"name": "user1",
"registration_date": "2020-05-09T06:17:26"
}
curl -X GET http://localhost:7800/api/users
[
{
"name": "user1",
"registration_date": "2020-05-09T06:17:26"
},
{
"name": "user2",
"registration_date": "2020-05-12T12:43:13"
},
{
"name": "user3",
"registration_date": "2020-05-15T07:47:50"
}
]
Create User
curl -H "content-type: application/json" \
-X PUT \
-i http://localhost:7800/api/users \
--data '{"name":"user4","password":"test"}'
[
{
"name": "user1",
"registration_date": "2020-05-09T06:17:26"
},
{
"name": "user2",
"registration_date": "2020-05-12T12:43:13"
},
{
"name": "user3",
"registration_date": "2020-05-15T07:47:50"
},
{
"name": "user4",
"registration_date": "2020-08-01T05:04:05"
}
]
Memory Usage
Memory usage as compared to interpreted languages was my primary motivation for looking into rust as a backend language. As of writing, the demo app uses less than 50MB of memory.
License
AGPLv3