Function as API

Deploy Functions. Get APIs.

Transform any piece of code into a scalable, secure, and ready-to-use API endpoint. No servers, no boilerplate, just your logic.

Join waitlist

function.do

import { Do, Fn } from '@do-are/sdk';

/**
 * @description Generates a personalized greeting.
 * @param { name: string } - The name to include in the greeting.
 * @returns { message: string } - The personalized greeting message.
 */
export const getGreeting: Fn = async ({ name }) => {
  if (!name) {
    throw new Error('A name is required to generate a greeting.');
  }

  const message = `Hello, ${name}! Welcome to the platform.`;

  // This object is returned as the JSON API response.
  return { message };
};

// Deploying this creates a unique API endpoint:
// POST https://your-name.function.do/getGreeting
// BODY { "name": "World" }

Deliver economically valuable work

Frequently Asked Questions

Do Work. With AI.