Sunday 31 May 2020

GCP cloud functions aren't allowing uploads to express API

Hi all, could you please assist. I have an express API wrapped in a GCP cloud function, I used the Serverless framework to manage my deployments to GCP. I have two endpoints currently, one is just a /helloWorld and the other an /uploadImage endpoint. I used Multer as my upload middleware.Both endpoints work fine locally, however, when I try to hit the API deployed to GCP cloud functions only the /helloWorld endpoints returns an expected response.The /upload endpoint returns a 500 with the message: "could not handle request" and what I gather from the logs is that, somehow, the image isn't being uploaded to GCP and the Multer middleware is basically receiving a null.I'm not sure where my issue is here. I have set all the requisites such as cors configs on the API.Any hints or guidance in this regard will be much appreciated.Thank you in advance. 🙏

Submitted May 31, 2020 at 05:39PM by EmoDiet

No comments:

Post a Comment