Netlify Functions

Build scalable, dynamic applications

Deploy server-side code that works as API endpoints, runs automatically in response to events, or processes more complex jobs in the background.

Write
Code your functions with JavaScript, TypeScript, or Go and drop them into your project’s netlify/functions folder. Everything else is automatic.
Deploy
Netlify deploys the functions you write as full API endpoints. Functions receive request context or event data, and return data back to your frontend.
Run
Trigger functions directly from your frontend through JavaScript or call them from other services via webhooks.
Use cases

Serverless Functions in action

"const API_ENDPOINT = 'https://cat-fact.herokuapp.com/facts';

export default async (request, context) => {
  try {
    const response = await fetch(API_ENDPOINT);
    const data = await response.json();
    return Response.json({ data });
  } catch (error) {
    console.log(error);
    return Response.json({ error: 'Failed fetching data' }, { status: 500 });
  }
};

Get shorter build times and faster page load speeds with on-demand builders.

Features

All part of one amazing workflow

Simplify your workflow

Manage everything in one project

Netlify Functions are files you write in JavaScript, TypeScript, or Go and then place inside your project under the path netlify/functions. (Easy, right? You can even configure that.)

Build, preview, and share instantly

Build & test locally

You can use Netlify CLI to run a local development server that you can share with others, run a local build and plugins, and deploy your site.

End-to-end deployment, simplified

Deploy backend functions & frontend code together

Automatically deploy your sites and apps, pushing frontend code and backend functions together, as a unit, without even requiring a maintenance window.

Release with confidence

Stage, preview, and rollback

Netlify Functions share all of Netlify’s beloved workflow features. Preview every commit with Deploy Preview links. Rollback when needed by simply clicking a prior deployment.

Control your releases

Run A/B testing and phased rollouts

Deploy and test multiple branches, and even control which users see which version. Plan full experiments and rolling upgrades that include both front and backend code changes. A/B test not just a button color, but an entire user workflow.

Moving all LiveChat websites to Netlify has empowered our Web Dev Team to iterate fast and independently.
Avatar of Maciej Malesa
Maciej Malesa CTO, LiveChat
Deploy & collaborate
Netlify Workflow
Work as a team, right in Git. Netlify neatly deploys every resource to the right place, from global static assets to serverless functions.
Learn more about workflows
Build & integrate
Netlify Build
The Git workflow for web development. Build, deploy, and manage modern web projects.
Learn more about faster builds
Execute at the edge
Netlify Edge
A fast, resilient network for web apps. Connected to your development workflow and designed to handle the most complex tasks - or even to run your own custom logic.
Learn more about Netlify Edge
Extensions
Addons & Integrations
Add powerful capabilities to every build and integrate easily with other SaaS services. Find the plugins you need from the community or even create your own.
Learn more about integrations

Start building on Netlify

Join millions of developers and teams bringing their ideas online.