0

I've been working in pubsub where I can successfully pull the data from a particular topic under a particular project in java. If I've to show these data in html, first I've to call the servlet method, then the servlet will call pubsub api to get the data, then I've to include that data in the response.

Since it involves an additional one layer (java) to access the data, is it possible to directly fecth the data in javascript call by skipping the java call..? Is there any api's available in google pubsub to serve for that purpose?

4

1 回答 1

2

该 api 可以在 javascript(使用 ajax)中使用,因为它只是 https 调用,
https://cloud.google.com/pubsub/reference/rest/
但是这是一个坏主意,因为您需要公开您的服务器帐户访问令牌和然后客户可以滥用它。

于 2015-05-01T15:07:10.627 回答