This project demonstrates a practical, incremental approach to migrate from JSON payloads to Protocol Buffers in a web app:
- Legacy JSON:
/api/order-json
(request/response are JSON) - Proto wrapper:
/api/order-proto
(request is protobufOrderWrapper
, which can carry legacy JSON injson_payload
) - Fully typed proto: gradually fill the
typed
message and remove the JSON
npm install
npm start
# open http://localhost:3000
Click the three buttons to compare:
- JSON (legacy)
- Protobuf (JSON wrapped inside)
- Protobuf (fully typed)
The page prints request/response and size comparison.