Sample Functions

Functions are blocks of code that run on demand without the need to manage any infrastructure. Develop on your local machine, test your code from the command line (using doctl), then deploy to a production namespace or App Platform — no servers required. Learn more about functions.


These repositories contain sample functions that you can deploy as components to App Platform. Each repository contains the necessary app-spec.yaml for App Platform and the requisite project structure, including project.yml.

Node.js Example Projects

This repository contains a project with a sample “Hello, World!” function written in Node.js JavaScript.
github.com
This repository contains a project with a sample QR code generator function written in Node.js JavaScript.
github.com

Python Example Projects

This repository contains a project with a sample “Hello, World!” function written in Python.
github.com
This repository contains a project with a sample API that returns jokes written in Python. It includes Pip requirements and a build script.
github.com
This repository contains a project with a sample API that sends SMS messages using Twilio written in Python.
github.com
This repository contains a project with a sample API that sends emails using SendGrid written in Python.
github.com

PHP Example Projects

This repository contains a project with a sample “Hello, World!” function written in PHP.
github.com
This repository contains a project with a sample API that converts numerals to words written in PHP. It includes a required Composer library and a build script.
github.com

Go Example Projects

This repository contains a project with a sample “Hello, World!” function written in Go.
github.com
This repository contains a project with a sample Go function that connects to a MySQL database.
github.com
This repository contains a project with a sample API that returns a pre-signed URL to upload or download a file to or from a DigitalOcean Space written in Go.
github.com