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?
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
So I had two options available to me:
- Change the access to the ICS file to public then share that URL to the user. However, this method would not allow me to dynamically change the file in the case that I would want to delete or change the file name.
- Serve the ICS file through my API – the method I had originally asked about in the original post.
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))
Answered By – Ryker
Answer Checked By – Katrina (AngularFixing Volunteer)