kalix-javascript-sdk
kalix-javascript-sdk copied to clipboard
Document how gRPC service maps to HTTP URLs
From @ennru: Both with and without the google.api.http annotations.
For example
rpc AddItem(AddLineItem) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/cart/{cart_id}/items/add"
body: "*"
};
}
From @raboof: There is a 'Transcoding HTTP' section now, but I agree it would be good to flesh this out more.
Perhaps it could be moved to its own page, something like "Providing HTTP API's". There we would also explain that Akka Serverless is not intended to be used to implement arbitrary HTTP API's, but is limited to those parts of HTTP that can be described by transcoding.
For example:
AFAICS there is no way to influence the HTTP response status code POST requests are supported. All messages that go to an entity must have an entity id, though - so also POST requests to an entity. If you want to create new entities, it might be better to use PUT, which has the additional advantage that it can be idempotent.