【发布时间】:2021-10-04 23:22:22
【问题描述】:
我有一个 grpc 客户端和服务器。我有一个原型文件。我正在使用 grpc 网关,我想为客户端使用 html。有一个路径localhost:8081/test,当我通过这条路径时,我希望它是一个 html 文件。 如何告诉处理程序在响应中提供 html 文件?
处理程序应该是什么样的?
syntax = "proto3";
option go_package = "/go_proto";
package api;
import "google/api/annotations.proto";
service authorization{
rpc Test(testRequest) returns (testResponse){
option(google.api.http) = {
get: "/test"
};
}
}
message testRequest{
}
message testResponse{
int32 arg1 = 1;
}
【问题讨论】: