-
Notifications
You must be signed in to change notification settings - Fork 32
Description
We set up some serverless functions following the example from this repo, but when I test a React module that uses one of our serverless functions locally via npm start, it always seems to receive a 200 OK status code even when the serverless function returns a 400 or 404.
You can see in the serverless logs that it's returning the correct status code:

But I always receive a 200 status code locally:

Based on the output in my terminal, it looks like these requests are running through a proxy:
attempting to proxy a POST serverless request to domain: 46512223.hs-sites.com for resource: /hs/serverless/create-user ...
I'm guessing that the proxy is just incorrectly converting everything to 200 for some reason. This makes building error handling for specific status codes very difficult, as I can't test the results locally. Even when I use the http://hslocal.net:3000/proxy?page= approach using a published page that includes my module, the same issue occurs.
The only way I can test status codes currently is if I deploy everything to Hubspot, but that's a super clunky DX.
Hoping someone can help! Thanks!!