Rapid Api tool is a simple API backend that allowed to quickly and easily to create/use CRUD Rest APIs.
Rapid Api tool uses Dynamodb as the database storage. You need to create DynamoDb table on aws and also create IAM user with access to the table.
go install github.com/apibrew/rapid-api/cmd/rapid-api@latest
You need to copy config.example.json to config.json and configure it.
You need to configure dynamodb and IAM details in config.json
rapid-api -config config.json
POST /books
Content-Type: application/json
{
"title": "The Lord of the Rings",
"author": "J.R.R. Tolkien",
"year": 1954
}
Result:
{
"author": "J.R.R. Tolkien",
"path": "/books/1",
"title": "The Lord of the Rings",
"year": 1954
}
GET /books/1
Result:
{
"author": "J.R.R. Tolkien",
"path": "/books/1",
"title": "The Lord of the Rings",
"year": 1954
}
GET /books
Result:
[
{
"author": "J.R.R. Tolkien",
"path": "/books/1",
"title": "The Lord of the Rings",
"year": 1954
}
]
POST /books/1
Content-Type: application/json
{
"title": "The Lord of the Rings",
"author": "J.R.R. Tolkien",
"year": 1955
}
Result:
{
"author": "J.R.R. Tolkien",
"path": "/books/1",
"title": "The Lord of the Rings",
"year": 1955
}
DELETE /books/1
POST /books/1/comments
Content-Type: application/json
{
"comment": "Great book!"
}
Result:
{
"comment": "Great book!",
"path": "/books/1/comments/1"
}
GET /books/1
Result:
{
"author": "J.R.R. Tolkien",
"comments": [
{
"comment": "Great book!",
"path": "/books/1/comments/1"
}
],
"path": "/books/1",
"title": "The Lord of the Rings",
"year": 1955
}
The magic happens here, it automatically handles all the relationships between the apis.