Menu

Helpers for Serverless Node.js Functions
📰

Helpers for Serverless Node.js Functions

Vercel News·Luc Leray·5 months ago
#Ovwvrsoc
#vercel#request#response#json#example
Reading 0:00
15s threshold

Migrating to serverless Node.js functions or creating new ones can mean that some of the tools and frameworks you used previously are not suitable anymore.

With today's feature release, we want to solve this problem by providing you with a set of default helpers exposed within your Node.js function .

Link to heading What's New

The recent update to serverless Node.js functions on Vercel introduces six default methods to the request and response payload:

request.query

request.cookies

request.body

response.status()

response.json()

response.send()

In order to access any of these methods, no changes are required on your side.

Link to heading Performance

With the introduction of helpers, your application receives a gain in performance when compared to a basic Express.js application:

NOTE: The benchmarks above are used to showcase the performance difference between serverless Node.js functions on Vercel and the Express.js framework.

While the relative improvement will stay the same, the actual time…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.