如何通过用户可以使用URL订阅的方式通过NodeJS API服务ICS文件?
因此,我在Google Cloud Storage中将ICS文件放置,我想通过我的API提供它,因此我不必公开ICS文件。但是,我不确定正确的方法是什么,以便用户可以将我的API调用链接放在其Google日历中作为网络计算链接以订阅日历。
这是可能的还是我必须提供指向ICS文件的直接链接,以便用户能够订阅日历?如果可能的话,我该如何在nodejs中使用该文件?
例子: https://storage.googleapis.com/example/calendar.ics
将能够通过 https://api.com/example/userid/calendars
webcal://api.com/example/example/userid/calendars在Google日历中使用
So I have my ics file in Google Cloud Storage and I would like to serve it through my API so I don't have to make the ics file public. However, I am not sure what is the right way to do that so that the user can put the link to my api call in their Google Calendar as a webcal link to subscribe to the calendar.
Is this possible or do I have to provide a direct link to the ICS file for the user to be able to subscribe to the calendar? If it is possible, how would I go about serving the file in NodeJS?
Example:https://storage.googleapis.com/example/calendar.ics
would be able to be served through https://api.com/example/userID/calendars
webcal://api.com/example/userID/calendars would then be used in the Google Calendars to subscribe to the calendar
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此,我有两个选择:
因此,对于方法 2,我基本上只需要执行 gcs.bucket('bucket_name').file('bucket 中 ics 文件的文件路径').download((error, content) => res.send(内容))
So I had two options available to me:
So for method 2, I basically just had to do
gcs.bucket('bucket_name').file('file path to ics file in bucket').download((error, content) => res.send(content))