kawaemon / shoutter

yet another sns
MIT License
3 stars 0 forks source link

フロントとバックエンドの通信確立 #5

Open kawaemon opened 1 year ago

kawaemon commented 1 year ago

http + protobuf を試してみたい。

loxygenK commented 1 year ago

試してみたい! RPC はかっこいい ワオは https://github.com/hyperium/tonic を使えばいいんかな

loxygenK commented 1 year ago

https://github.com/hyperium/tonic/blob/b3358dc6acf11ec800571735de1e1f1e449ec96a/examples/src/helloworld/server.rs#L7 tonic、include_proto! でバインディング生成(?)するのすごいな、、

kawaemon commented 1 year ago

grpc には http2 が必要で、web ブラウザとの通信にはプロトコル変換用のプロキシ噛ませなきゃいけなかったりして大変めんどくさいので、今回は http(REST) + protobuf にしたいなぁと思ってます。 今まで通りの REST API のリクエスト/レスポンスの Body が JSON じゃなくて protobuf になるイメージ。 だから、tonic じゃなくて prost を使うことになると思います