Simple CRUD blogging API built using golang and gRPC
Run the following command:
go run blogging_server/main.go
- You can create a blog post using the following command
grpcurl -plaintext -d '{
"title": "My First Blog Post",
"content": "This is the content of my first blog post.",
"author": "John Doe",
"publicationdate": "2024-03-03T00:00:00Z",
"tags": ["grpc", "protobuf"]
}' localhost:50051 bloggingapi.bloggingapi.CreateBlog
- You can retrieve a blog post using the following command:
grpcurl -plaintext -format text -d 'postID: <postID>' localhost:50051 bloggingapi.bloggingapi.ReadBlog
- You can update a blog post using the following command:
grpcurl -plaintext -d '{
"postID": "<post_id>",
"post": {
"title": "My First Blog Post updated",
"content": "This is the content of my first blog post.",
"author": "John Doe",
"publicationdate": "2024-03-03T00:00:00Z",
"tags": ["grpc", "protobuf"]
}
}' localhost:50051 bloggingapi.bloggingapi.UpdateBlog
- You can delete a blog post using the following command:
grpcurl -plaintext -format text -d 'postID: <postID>' localhost:50051 bloggingapi.bloggingapi.DeleteBlog
Run the following command:
go test -v ./...