Migrate from REST to gRPC
Last updated
Was this helpful?
Last updated
Was this helpful?
[Under construction]
Repositories
REST :
gRPC :
Create protobuf
[django-grpc-framework] () document.
Backend differences
REST :
djangorestframework
Implementation of
book.apis.py
book.serializers.py
Middleware cors : bypass the cross site origin.
Handle snake-case and camel-case inconsistency.
grpc :
djangorestframework + djangogrpcframework + grpcio + grpcio-tools
Implementation of
book.schema.py
Frontend differences The difference is only the database query service.
REST : Use URL end point. category.js
request.js
grpc : Always use POST
method to submit query
. category.js
request.js
```javascript const Request = {