Migrate from REST to gRPC
[Under construction]
Repositories
Create protobuf
[django-grpc-framework] (https://djangogrpcframework.readthedocs.io/en/latest/protos.html#generate-proto-for-model) 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 submitquery
. category.jsrequest.js
```javascript const Request = {
Last updated