Sample Functions

Validated on 23 May 2022 • Last edited on 17 Apr 2025

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.

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

JavaScript Hello, World!

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

github.com
QR Code Generator

This repository contains a project with a sample QR code generator function written in Node.js JavaScript.

github.com

Python Example Projects

Python Hello, World!

This repository contains a project with a sample “Hello, World!” function written in Python.

github.com
Jokes API

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
Twilio SMS API

This repository contains a project with a sample API that sends SMS messages using Twilio written in Python.

github.com
SendGrid Emails API

This repository contains a project with a sample API that sends emails using SendGrid written in Python.

github.com

PHP Example Projects

PHP Hello, World!

This repository contains a project with a sample “Hello, World!” function written in PHP.

github.com
Numbers to Words API

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

Go Hello, World!

This repository contains a project with a sample “Hello, World!” function written in Go.

github.com
MySQL Database

This repository contains a project with a sample Go function that connects to a MySQL database.

github.com
Spaces Presigned URL API

This repository contains a project with a sample API that returns a presigned URL to upload or download a file to or from a DigitalOcean Space written in Go.

github.com

We can't find any results for your search.

Try using different keywords or simplifying your search terms.