Just some quick notes on creating a Google Cloud Function that serves a REST API to get your Medium posts

Suru Dissanaike
HiMinds
Published in
1 min readSep 9, 2019
Photo by Bundo Kim on Unsplash

Maybe someday Medium will provide an API to show your posts on your website. Until then you need to create your own.

Using Google Cloud functions I do not need to worry about the hosting. If you want to get started with Google Cloud Functions, the Google documentation is pretty sweet; just head over here.

I have enabled Cross-Origin Resource Sharing (CORS).

I am using XMLHttpRequest and fast-xml-parser to do the heavy lifting.

Here is my code:

Thank you for reading! Take care and hope to see you soon. 🙏🏽

--

--