How to use the faastjs.faastGoogle function in faastjs

To help you get started, we’ve selected a few faastjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github faastjs / examples / gcp-js / index.js View on Github external
async function main() {
    const m = await faastGoogle(funcs, {
        memorySize: 1024,
        timeout: 60,
        region: "us-central1"
    });
    console.log(`## Logs`);
    console.log(`${m.logUrl()}`);
    try {
        const result = await m.functions.hello("GCP");
        console.log(`## Output`);
        console.log(result);
        console.log(`## Cost`);
        const cost = await m.costSnapshot();
        console.log(`${cost}`);
        console.log(`## Stats`);
        console.log(`${m.stats()}`);
    } finally {
github faastjs / examples / gcp-ts / index.ts View on Github external
async function main() {
    const m = await faastGoogle(funcs, {
        memorySize: 1024,
        timeout: 60,
        region: "us-central1"
    });
    console.log(`## Logs`);
    console.log(`${m.logUrl()}`);
    try {
        const result = await m.functions.hello("GCP");
        console.log(`## Output`);
        console.log(result);
        console.log(`## Cost`);
        const cost = await m.costSnapshot();
        console.log(`${cost}`);
        console.log(`## Stats`);
        console.log(`${m.stats()}`);
    } finally {