Google Cloud Functions and Serverless Path Parameters

I’m trying to transition an express node service to using the serverless framework and Google Cloud Functions.

No matter what I tried I kept running into an issue where i was getting this error:  Unexpected token : in JSON at position 19

category:
handler: category
events:
- http:
path: category/{id}
method: get
cors: true

After some Google searches I found this issue: https://github.com/serverless/serverless-google-cloudfunctions/issues/78

The fix was doing this instead:  - http: category/{id}

Let’s hope I don’t need to change my REST verb or set cors.

Advertisements

Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: