{"id":345744,"date":"2021-08-03T13:23:32","date_gmt":"2021-08-03T20:23:32","guid":{"rendered":"https:\/\/css-tricks.com\/?p=345744"},"modified":"2021-08-03T13:23:35","modified_gmt":"2021-08-03T20:23:35","slug":"serverless-functions-as-proxies","status":"publish","type":"post","link":"https:\/\/css-tricks.com\/serverless-functions-as-proxies\/","title":{"rendered":"Serverless Functions as Proxies"},"content":{"rendered":"\n

The first time cloud functions \/ serverless functions clicked for me was when I saw and tried Auth0’s (now defunct) Webtask<\/a>. It was a little CodePen-like IDE<\/abbr> but you didn’t really see<\/em> anything aside from code and logs. The point was to write little bits of Node when you hit the functions URL (that’s literally exactly what a serverless function is). It would even store your secrets<\/em> for you, meaning that you could use the serverless function as a proxy<\/em>. You hit the function, the function hits the API using your unexposed API Key secrets, the API returns data, the function then returns data, and that data is available to the client side for you to work with. The entire point was 1) you can snag data from an otherwise totally static website, and 2) your API keys are protected. Brilliant.<\/p>\n\n\n\n\n\n\n\n

I still miss Webtask, but I’m sure there are better and fancier things these days. I don’t have a solid handle on the whole landscape. Even AWS has an online editor for lambdas (a “lambda<\/dfn>” is AWS’s standards-setting implementation of what a serverless function is), but using the AWS console directly for anything isn’t usually… very good. Functions in AWS Amplify<\/a> are probably a better bet there.<\/p>\n\n\n\n

My guess is the proper modern way of building these things are things like…<\/p>\n\n\n\n