Skip to content
Dashboard

Helpers for Serverless Node.js Functions

Link to headingWhat's New

Link to headingPerformance

Link to headingHow to Use Helpers

Link to headingrequest.query

module.exports = (request, response) => {
console.log(request.query);
};

{ "key": "value" }

Link to headingrequest.cookies

module.exports = (request, response) => {
console.log(request.cookies);
};

{
"cookie1": "i am a cookie",
"cookie2": "i am yet another cookie"
}

Link to headingrequest.body

module.exports = (request, response) => {
console.log(request.body);
};

{
"firstKey": "example value",
"secondKey": "another example value"
}

Link to headingresponse.status()

module.exports = (request, response) => {
response.status(403);
response.json({ error: 'You do not have access' });
};

Link to headingresponse.json()

module.exports = (request, response) => {
response.json({ property: 'value' });
};

Link to headingresponse.send()

module.exports = (request, response) => {
const example = Buffer.from('Welcome!');
response.send(example);
};

Link to headingConclusion