Function Compute provides ready-to-use sample code for common runtimes, web frameworks, and use cases. Browse the categories below to find a starting point that matches your tech stack or scenario, then follow the README.md in each repository to deploy it.
Hello World
Each Hello World sample contains the minimum code needed to create and invoke a Function Compute function. Samples are organized by runtime type.
Custom runtimes
Use a custom runtime to run languages or runtime versions not supported by built-in runtimes.
Custom containers
Package your function as a container image to bring your own OS, dependencies, and toolchain.
Web applications
Each sample shows how to run a web framework on Function Compute and handle HTTP requests. Pick the framework that matches your stack.
Node.js
| Framework | Description |
|---|
| Express | Minimal, unopinionated Node.js web framework |
| Egg | Enterprise Node.js framework built on Koa |
| Next.js | React framework with server-side rendering |
| Nuxt.js | Vue framework with server-side rendering |
| Hapi | Configuration-centric Node.js framework |
| Koa | Lightweight middleware-based Node.js framework |
| Nest | TypeScript-first Node.js framework |
| Excalidraw | Collaborative whiteboard application |
| Fastify | High-performance Node.js web framework |
| Think.js | Full-featured Node.js MVC framework |
Python
| Framework | Description |
|---|
| Flask | Lightweight Python web microframework |
| Tornado | Asynchronous Python web framework |
| Web.py | Simple, minimal Python web framework |
| Django | Batteries-included Python web framework |
| FastAPI | Modern Python API framework with automatic OpenAPI docs |
PHP
| Framework | Description |
|---|
| ThinkPHP | Full-featured PHP MVC framework |
| Laravel | PHP framework with an expressive syntax |
Go
| Framework | Description |
|---|
| Gin | High-performance Go HTTP framework |
| Beego | Full-featured MVC framework for Go |
Java
| Framework | Description |
|---|
| SpringBoot | Production-ready Java application framework |
Other
| Framework | Description |
|---|
| Nginx | Serves static content or acts as a forward proxy |
| Nginx reverse proxy | Routes incoming requests to one or more upstream services |
Static website applications
| Sample | Description |
|---|
| Docusaurus | Builds and serves a Docusaurus documentation site on Function Compute |
AI scenarios
| Sample | Description |
|---|
| PyTorch | Runs PyTorch model inference in a Function Compute function |
| TensorFlow | Runs TensorFlow model inference in a Function Compute function |
| OCR | Extracts text from images using optical character recognition |
| Object detection | Detects and classifies objects in images |
| GPU-accelerated applications | Runs compute-intensive workloads on GPU instances |
Audio and video processing