
Makers Cloud Functions
- 58 installs
- 2k repo stars
- Updated July 16, 2026
- tencentedgeone/edgeone-pages-skills
Use when working on frontend tasks.
About
Makers Cloud Functions is a skill that helps with frontend work. It supports teams during the build phase of development. Use this skill to improve your frontend processes and deliverables.
- Cloud
- Functions
- Makers
Makers Cloud Functions by the numbers
- 58 all-time installs (skills.sh)
- +7 installs in the week ending Jul 27, 2026 (Skillselion tracking)
- Ranked #310 of 782 Skill Development skills by installs in the Skillselion catalog
- Data as of Jul 30, 2026 (Skillselion catalog sync)
npx skills add https://github.com/tencentedgeone/edgeone-pages-skills --skill makers-cloud-functionsAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 58 |
|---|---|
| repo stars | ★ 2k |
| Last updated | July 16, 2026 |
| Repository | tencentedgeone/edgeone-pages-skills ↗ |
What it does
Use when working on frontend tasks.
Files
Cloud Functions
Server-side functions supporting Node.js, Go, and Python runtimes.
Runtime Selection
| Runtime | When to use | Reference |
|---|---|---|
| Node.js | Express/Koa patterns, npm ecosystem | references/node-functions.md |
| Go | High performance, Gin/Echo/Chi | references/go-functions.md |
| Python | Flask/FastAPI, ML libraries | references/python-functions.md |
Go Functions
Go runtime functions under cloud-functions/. High-performance compiled language with low memory footprint and fast cold start. Supports Handler mode (file-system routing) and Framework mode (Gin, Echo, Fiber, Chi).
Runtime: Go 1.26+ — cross-compiled automatically by the platform. No manual build configuration needed.
Development Modes
| Mode | Use Case | Routing | Framework |
|---|---|---|---|
| Handler | Simple APIs, Serverless style | File-system routing (file = route) | None (standard net/http) |
| Framework | Full Web apps, RESTful APIs | Framework built-in routing | Gin / Echo / Fiber / Chi |
⚠️ You can only use one mode per project — do NOT mix Handler and Framework modes.
Handler Mode
Each .go file exports a handler function matching the http.HandlerFunc signature.
File: cloud-functions/hello.go
package handler
import (
"encoding/json"
"net/http"
)
func Handler(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]string{
"message": "Hello from Go Functions on EdgeOne Pages!",
})
}Access: GET /hello
Key rules for Handler mode:
- Package must be
handler - Exported function must match
http.HandlerFuncsignature:func(http.ResponseWriter, *http.Request) - Function name can be any valid exported Go name (e.g.
Handler,ServeHTTP,GetUsers)
Framework Mode (Gin example)
Zero-config, out-of-the-box: Write standard framework code — the platform auto-handles port adaptation and path mapping at build time.
File: cloud-functions/api.go
package main
import (
"net/http"
"github.com/gin-gonic/gin"
)
func main() {
r := gin.Default()
v1 := r.Group("/v1")
{
v1.GET("/hello", func(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{
"message": "Hello from Gin on EdgeOne Pages!",
})
})
users := v1.Group("/users")
{
users.GET("", listUsersHandler)
users.GET("/:id", getUserHandler)
users.POST("", createUserHandler)
}
}
r.Run(":9000")
}Access: GET /api/v1/hello, GET /api/v1/users, etc.
Entry file name determines URL prefix
| Entry file | URL prefix | Frontend path | Framework route |
|---|---|---|---|
index.go | / (no prefix) | /v1/hello | /v1/hello |
main.go | /main | /main/v1/hello | /v1/hello |
api.go | /api | /api/v1/hello | /v1/hello |
When the entry file is NOT index.go, the frontend must add the filename prefix. But framework routes stay unchanged — the prefix is stripped before reaching the framework.Framework Mode — Echo example
File: cloud-functions/api.go
package main
import (
"net/http"
"github.com/labstack/echo/v4"
)
func main() {
e := echo.New()
e.GET("/hello", func(c echo.Context) error {
return c.JSON(http.StatusOK, map[string]string{
"message": "Hello from Echo!",
})
})
e.Logger.Fatal(e.Start(":9000"))
}File-system Routing (Handler mode)
cloud-functions/
├── index.go
├── hello-pages.go
├── helloworld.go
├── api/
│ ├── users/
│ │ ├── list.go
│ │ ├── geo.go
│ │ └── [id].go
│ ├── visit/
│ │ └── index.go
│ └── [[default]].go| File path | Route |
|---|---|
cloud-functions/index.go | example.com/ |
cloud-functions/hello-pages.go | example.com/hello-pages |
cloud-functions/api/users/list.go | example.com/api/users/list |
cloud-functions/api/users/[id].go | example.com/api/users/:id |
cloud-functions/api/[[default]].go | example.com/api/* (catch-all) |
Dynamic Routes
| File path | Example URL | Match? |
|---|---|---|
api/users/[id].go | /api/users/1024 | ✅ Yes |
api/users/[id].go | /api/users/vip/1024 | ❌ No |
api/[[default]].go | /api/books/list | ✅ Yes |
api/[[default]].go | /api/1024 | ✅ Yes |
Supported Frameworks
- Gin — go-gin-template
- Echo — go-echo-template
- Chi — go-chi-template
- Fiber — supported, similar pattern
- Standard `net/http` — Handler mode, no framework needed
Local Development
Prerequisites: Go installed locally.
npm install -g edgeone # Install CLI
edgeone pages dev # Start local dev server
# Push to remote repo to deployLimits
| Resource | Limit |
|---|---|
| Code package size | 128 MB |
| Request body | 6 MB |
| Wall clock time | 120 seconds |
| Runtime | Go 1.26+ (backward compatible) |
⚠️ Do NOT store persistent files locally — use external storage (e.g. Tencent Cloud COS) for persistent data.
Template Projects
- Handler mode: go-handler-template | Preview
- Gin framework: go-gin-template | Preview
- Echo framework: go-echo-template | Preview
- Chi framework: go-chi-template | Preview
Node.js Functions
Node.js v20.x runtime functions under cloud-functions/. Full npm ecosystem support. Ideal for complex backend logic, database access, Express/Koa frameworks, and WebSocket.
Runtime: Node.js v20.x — supports ES modules, full npm ecosystem, and WebSocket.
Basic function
File: cloud-functions/api/data.js
export function onRequestGet(context) {
return Response.json({
message: 'Hello from Node.js Functions!',
region: context.server.region,
});
}
export async function onRequestPost(context) {
const body = await context.request.json();
// Process body...
return Response.json({ received: body }, { status: 201 });
}Access: GET /api/data, POST /api/data
Handler methods
| Handler | HTTP Method |
|---|---|
onRequest(context) | All methods (GET, POST, PATCH, PUT, DELETE, HEAD, OPTIONS) |
onRequestGet(context) | GET |
onRequestPost(context) | POST |
onRequestPatch(context) | PATCH |
onRequestPut(context) | PUT |
onRequestDelete(context) | DELETE |
onRequestHead(context) | HEAD |
onRequestOptions(context) | OPTIONS |
All handlers return Response | Promise<Response>.
EventContext object
export function onRequest(context) {
const {
uuid, // EO-LOG-UUID unique request identifier
request, // Standard Request object
params, // Dynamic route params, e.g. { id: "123" }
env, // Environment variables from Pages console
clientIp, // Client IP address
server, // { region: string, requestId: string }
geo, // Client geolocation info
} = context;
return new Response('OK');
}Using npm packages
// cloud-functions/api/data.js
import mysql from 'mysql2/promise';
export async function onRequestGet(context) {
const connection = await mysql.createConnection({
host: context.env.DB_HOST,
user: context.env.DB_USER,
password: context.env.DB_PASSWORD,
database: context.env.DB_NAME,
});
const [rows] = await connection.execute('SELECT * FROM users LIMIT 10');
await connection.end();
return Response.json({ users: rows });
}⚠️ Install dependencies in project root package.json — the platform builds them automatically.
Express integration
File: cloud-functions/api/[[default]].js
import express from 'express';
const app = express();
app.use(express.json());
// Add logging middleware
app.use((req, res, next) => {
console.log(`[${new Date().toISOString()}] ${req.method} ${req.url}`);
next();
});
// Root route → GET /api/
app.get('/', (req, res) => {
res.json({ message: 'Hello from Express!' });
});
// GET /api/users/:id
app.get('/users/:id', (req, res) => {
res.json({ userId: req.params.id });
});
// POST /api/users
app.post('/users', (req, res) => {
res.status(201).json({ user: req.body });
});
// MUST export the app — do NOT call app.listen()
export default app;Key rules for Express/Koa:
- All framework routes go in one function file using
[[...]]naming pattern (e.g.[[default]].js) - MUST
export default app— do NOT callapp.listen()or start HTTP server - No need to set up port listening — the platform handles it
Koa integration
File: cloud-functions/api/[[default]].js
import Koa from 'koa';
import Router from '@koa/router';
import bodyParser from 'koa-bodyparser';
const app = new Koa();
const router = new Router();
app.use(bodyParser());
router.get('/hello', (ctx) => {
ctx.body = { message: 'Hello from Koa!' };
});
router.post('/data', (ctx) => {
ctx.body = { received: ctx.request.body };
});
app.use(router.routes());
app.use(router.allowedMethods());
// MUST export — do NOT call app.listen()
export default app;File-system Routing
cloud-functions/
├── index.js
├── hello-pages.js
├── api/
│ ├── users/
│ │ ├── list.js
│ │ ├── geo.js
│ │ └── [id].js
│ ├── visit/
│ │ └── index.js
│ └── [[default]].js| File path | Route |
|---|---|
cloud-functions/index.js | example.com/ |
cloud-functions/hello-pages.js | example.com/hello-pages |
cloud-functions/api/users/list.js | example.com/api/users/list |
cloud-functions/api/users/[id].js | example.com/api/users/:id |
cloud-functions/api/[[default]].js | example.com/api/* (catch-all) |
Notes:
- Trailing slash/is optional:/hello-pagesand/hello-pages/both route tocloud-functions/hello-pages.js
- If a Node.js route conflicts with a static asset route, the static asset takes priority
- Routes are case-sensitive
Express/Koa framework routing
cloud-functions/
└── express/
└── [[default]].js # Express/Koa entry file, all routes inside- All routes consolidated in one function file with
[[...]]naming - No HTTP server startup needed — just export the framework instance
- The builder identifies the file as a function only when
export default appis present
Dynamic Routes
// cloud-functions/api/users/[id].js
export function onRequestGet(context) {
return new Response(`User id is ${context.params.id}`);
}| File path | Example URL | Match? |
|---|---|---|
api/users/[id].js | /api/users/1024 | ✅ Yes |
api/users/[id].js | /api/users/vip/1024 | ❌ No |
api/[[default]].js | /api/books/list | ✅ Yes |
api/[[default]].js | /api/1024 | ✅ Yes |
WebSocket
File: cloud-functions/api/ws.js
export function onRequestGet(context) {
const { request } = context;
// Check for WebSocket upgrade
const upgradeHeader = request.headers.get('Upgrade');
if (upgradeHeader !== 'websocket') {
return new Response('Expected WebSocket', { status: 426 });
}
// Create WebSocket pair
const { socket, response } = new WebSocketPair();
socket.addEventListener('message', (event) => {
socket.send(`Echo: ${event.data}`);
});
socket.addEventListener('close', () => {
console.log('WebSocket closed');
});
return response;
}Local Development
npm install -g edgeone # Install CLI
edgeone pages dev # Start local dev server on port 8088
# Push to remote repo to deployLimits
| Resource | Limit |
|---|---|
| Code package size | 128 MB |
| Request body | 6 MB |
| Wall clock time | 120 seconds |
| Runtime | Node.js v20.x |
⚠️ Do NOT store persistent files locally — use external storage (e.g. Tencent Cloud COS) for persistent data.
Template Projects
- MySQL connection: mysql-template | Preview
- Express: express-template | Preview
- Koa: koa-template | Preview
- AI Voice Chat (WebSocket): pages-ai-voice-chat | Preview
Python Functions
Python 3.10 runtime functions under cloud-functions/. Supports Handler class, WSGI (Flask/Django), and ASGI (FastAPI/Sanic) modes with automatic dependency detection.
Runtime: Python 3.10 — auto-detects framework, auto-installs dependencies, no manual configuration needed.
Development Modes
| Mode | Use Case | Routing | Framework |
|---|---|---|---|
| Handler | Simple APIs, Serverless style | File-system routing (file = route) | None (standard BaseHTTPRequestHandler) |
| WSGI Framework | Full Web apps, RESTful APIs | Framework built-in routing | Flask, Django |
| ASGI Framework | Full Web apps, RESTful APIs | Framework built-in routing | FastAPI, Sanic |
Handler Mode
File: cloud-functions/api/hello.py
from http.server import BaseHTTPRequestHandler
class handler(BaseHTTPRequestHandler):
def do_GET(self):
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write('{"message": "Hello from Python Functions!"}'.encode('utf-8'))Access: GET /api/hello
Key rules for Handler mode:
- Class must be named
handler(lowercase) and inherit fromBaseHTTPRequestHandler - Implement
do_GET,do_POST,do_PUT,do_DELETEetc. for different HTTP methods
Handling POST requests
# cloud-functions/api/users/index.py
from http.server import BaseHTTPRequestHandler
import json
class handler(BaseHTTPRequestHandler):
def do_POST(self):
content_length = int(self.headers.get('Content-Length', 0))
body = self.rfile.read(content_length).decode('utf-8')
data = json.loads(body) if body else {}
self.send_response(201)
self.send_header('Content-Type', 'application/json')
self.end_headers()
response = json.dumps({'message': 'Created', 'data': data})
self.wfile.write(response.encode('utf-8'))Handler class attributes
| Attribute/Method | Type | Description |
|---|---|---|
self.path | str | Request path (with query params) |
self.command | str | HTTP method (GET, POST, etc.) |
self.headers | dict-like | Request headers |
self.rfile | file | Request body input stream |
self.wfile | file | Response body output stream |
self.send_response(code) | method | Send HTTP status code |
self.send_header(key, value) | method | Send response header |
self.end_headers() | method | End response headers |
Getting query parameters
# cloud-functions/api/search.py
from http.server import BaseHTTPRequestHandler
from urllib.parse import urlparse, parse_qs
class handler(BaseHTTPRequestHandler):
def do_GET(self):
parsed = urlparse(self.path)
query_params = parse_qs(parsed.query)
name = query_params.get('name', ['Guest'])[0]
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write(f'{{"hello": "{name}"}}'.encode('utf-8'))Flask Framework (WSGI)
File: cloud-functions/api/index.py
from flask import Flask, jsonify, request
app = Flask(__name__)
@app.route('/users', methods=['GET'])
def get_users():
return jsonify({
'users': [
{'id': 1, 'name': 'Alice'},
{'id': 2, 'name': 'Bob'}
]
})
@app.route('/users', methods=['POST'])
def create_user():
data = request.get_json()
return jsonify({'message': 'User created', 'user': data}), 201Access: GET /api/users, POST /api/users
Route prefix stripping: The runtime auto-strips the file-system route prefix.api/index.py→ prefix/api, so request/api/usersbecomes/usersinside Flask. Define framework routes as relative paths only.
FastAPI Framework (ASGI)
File: cloud-functions/api/index.py
from fastapi import FastAPI
app = FastAPI()
@app.get('/items')
async def list_items():
return {'items': [{'id': 1, 'name': 'Item A'}, {'id': 2, 'name': 'Item B'}]}
@app.get('/items/{item_id}')
async def get_item(item_id: int):
return {'item_id': item_id, 'name': f'Item {item_id}'}
@app.post('/items')
async def create_item(item: dict):
return {'message': 'Item created', 'item': item}Access: GET /api/items, GET /api/items/123, POST /api/items
File-system Routing
cloud-functions/
├── api/
│ ├── index.py
│ ├── hello.py
│ ├── users/
│ │ ├── index.py
│ │ ├── list.py
│ │ └── [id].py
│ ├── orders/
│ │ └── index.py
│ └── [[default]].py| File path | Route |
|---|---|
cloud-functions/api/index.py | example.com/api |
cloud-functions/api/hello.py | example.com/api/hello |
cloud-functions/api/users/index.py | example.com/api/users |
cloud-functions/api/users/[id].py | example.com/api/users/:id |
cloud-functions/api/[[default]].py | example.com/api/* (catch-all) |
Route matching priority (high → low)
1. Static routes — exact match (e.g. /api/users/list) 2. Single-level dynamic — [param] matches one segment (e.g. /api/users/[id]) 3. Catch-all dynamic — [[param]] matches one or more segments (e.g. /api/[[default]])
Entry file recognition
Only .py files with these patterns are registered as routes:
class handler(BaseHTTPRequestHandler)— Handler class modeapp = Flask(...)/app = FastAPI(...)— Framework instance modeapplication = get_wsgi_application()— Django WSGI mode
Other .py files are treated as helper modules — copied to build output for import but not registered as routes.
Dynamic Route Parameters
# cloud-functions/api/users/[id].py
from http.server import BaseHTTPRequestHandler
class handler(BaseHTTPRequestHandler):
def do_GET(self):
user_id = self.path.strip('/')
self.send_response(200)
self.send_header('Content-Type', 'application/json')
self.end_headers()
self.wfile.write(f'{{"user_id": "{user_id}"}}'.encode('utf-8'))Dependency Management
Auto-detection
The builder scans all .py files under cloud-functions/ for import statements and auto-detects third-party packages. Supported: fastapi, flask, django, sanic, requests, httpx, pydantic, sqlalchemy, redis, pymongo, numpy, pandas, etc.
Manual dependencies
Place requirements.txt in one of these locations (priority order): 1. cloud-functions/requirements.txt (preferred) 2. Project root requirements.txt
# cloud-functions/requirements.txt
flask>=2.0.0
redis>=4.0.0
openai>=1.0.0User-declared versions take highest priority when merged with auto-detected dependencies.
Excluded directories
These are not scanned or copied to build output:
__pycache__,.git,node_modulesvenv,.venv(virtual environments)scripts(local test scripts)tests,.pytest_cache(test files)
Local Development
npm install -g edgeone # Install CLI
edgeone pages dev # Start local dev server
# Push to remote repo to deployLimits
| Resource | Limit |
|---|---|
| Code package size | 128 MB (including dependencies) |
| Request body | 6 MB |
| Wall clock time | 120 seconds |
| Runtime | Python 3.10 |
⚠️ Do NOT store persistent files locally — use external storage (e.g. Tencent Cloud COS) for persistent data.
Template Projects
- Handler mode: python-handler-template | Preview
- FastAPI: python-fastapi-template | Preview
- Flask: python-flask-template | Preview
- Django: python-django-template | Preview