curl -X \
GET https://large1.faasplus.com/acme/demo/ping
const handleRequest = async () => {
const executedAt = new Date().toString();
return {
'res':'pong',
'executed_at':executedAt
};
};
{
"res": "pong",
"executed_at": "Thu Sep 12 2024 12:43:23"
}
With FaasPlus, turning your JavaScript and JSON knowledge into powerful, scalable cloud functions is effortless. No complex setups or steep learning curves—just write your code, deploy, and watch it scale. FaasPlus streamlines the function-building process, so you can focus on creating, not managing infrastructure. It’s your favorite languages, now supercharged for the cloud.
Imagine you receive JSON data with two values, a and b, and you need to calculate their sum. With FaasPlus, it's as simple as writing a few lines of JavaScript.
In this case, FaasPlus extracts the values from the JSON, performs the calculation, and returns the result—all in one seamless function. This showcases how easily FaasPlus handles real-world scenarios where working with JSON data is essential, letting you focus on logic while it manages the heavy lifting.
curl -X POST https://large1.faasplus.com/acme/demo/sum \
-H 'Content-Type: application/json' \
-d '{"a":10,"b":20}'
const handleRequest = async (req) => {
const a=req.body.a||0;
const b=req.body.b||0;
const sum=a+b;
return {
'sum':sum
}
};
{
'sum':30
}
With FaasPlus, you can effortlessly interact with external APIs and services using JavaScript’s built-in fetch. Whether you're retrieving data from third-party services or posting data to external APIs, FaasPlus gives you the flexibility to seamlessly integrate external resources into your functions. For example, making an HTTP request to fetch external data is as simple as:
curl -X GET https://large1.faasplus.com/acme/demo/ext-call?postId=1
const handleRequest = async (req,fetch) => {
//request postId as paramters (query string)
const postId = req.params.postId || 1;
//request an external data
const res = await fetch(`https://jsonplaceholder.org/posts/${postId}`);
//read as json
const jsonRes=await res.json();
//add additional field
const executedAt=new Date().toString();
//compose new result
const myRes={
id:jsonRes.id,
slug:jsonRes.slug,
executedAt:executedAt
}
return myRes;
};
{
'id':1,
'slug':'condimentum.',
'executedAt':'Wed Sep 11 2024 11:13:10'
}
FaasPlus goes beyond basic functions. You can easily use query string parameters to fine-tune your inputs and leverage workspace variables to securely store project URLs, secrets, and other sensitive data. Need to make SOAP calls? No problem—FaasPlus supports that too, allowing you to integrate with a wide range of services. From handling complex APIs to managing secure environments, FaasPlus has you covered. See all use cases (examples).
See all use cases (examples)Sign Up and Start Using FaasPlus Now—It’s Free! Getting started with FaasPlus is quick and easy. Signing up takes just a few seconds, and you can begin building and deploying functions right away at no cost.
Get started