• Product Introduction
  • Quick Start
    • Importing a Git Repository
    • Starting From a Template
    • Direct Upload
    • Start with AI
  • Framework Guide
    • Frontends
      • Vite
      • React
      • Vue
      • Hugo
      • Other Frameworks
    • Backends
    • Full-stack
      • Next.js
      • Nuxt
      • Astro
      • React Router
      • SvelteKit
      • TanStack Start
      • Vike
    • Custom 404 Page
  • Project Guide
    • Project Management
    • edgeone.json
    • Configuring Cache
    • Building Output Configuration
    • Error Codes
  • Build Guide
  • Deployment Guide
    • Overview
    • Create Deploys
    • Manage Deploys
    • Deploy Button
    • Using Github Actions
    • Using Gitlab CI/CD
    • Using CNB Plugin
    • Using IDE PlugIn
    • Using CodeBuddy IDE
  • Domain Management
    • Overview
    • Custom Domain
    • HTTPS Configuration
      • Overview
      • Apply for Free Certificate
      • Using Managed SSL Certificate
    • Configure DNS CNAME Record
  • Observability
    • Overview
    • Metric Analysis
    • Log Analysis
  • Pages Functions
    • Overview
    • Edge Functions
    • Cloud Functions
      • Overview
      • Node.js
      • Python
      • Go
  • Middleware
  • KV Storage
  • Edge AI
  • API Token
  • EdgeOne CLI
  • Copilot
    • Overview
    • Quick Start
  • Pages MCP
  • Pages Skills
  • Message Notification
  • Integration Guide
    • AI
      • Dialogue Large Models Integration
      • Large Models for Images Integration
    • Database
      • Supabase Integration
      • Pages KV Integration
    • Ecommerce
      • Shopify Integration
      • WooCommerce Integration
    • Payment
      • Stripe Integration
      • Integrating Paddle
    • CMS
      • WordPress Integration
      • Contentful Integration
      • Sanity Integration
      • Payload Integration
    • Authentication
      • Supabase Integration
      • Clerk Integration
  • Best Practices
    • AI Dialogue Deployment: Deploy Project with One Sentence Using Skill
    • Using General Large Model to Quickly Build AI Application
    • Use the DeepSeek model to quickly build a conversational AI site
    • Building an Ecommerce Platform with Shopify
    • Building a SaaS Site Using Supabase and Stripe
    • Building a Company Brand Site Quickly
    • How to Quickly Build a Blog Site
  • Migration Guides
    • Migrating from Vercel to EdgeOne Pages
    • Migrating from Cloudflare Pages to EdgeOne Pages
    • Migrating from Netlify to EdgeOne Pages
  • Troubleshooting
  • FAQs
  • Contact Us
  • Release Notes

Overview

Pages Functions is a Serverless function service provided by EdgeOne Pages. It allows you to write and deploy server-side code in the project without configuration or managing servers. The platform automatically scales based on request volume to help you quickly build full-stack applications.

Currently available two types of Functions:
Edge Functions: Runs on EdgeOne global edge nodes, provides ultra-low latency and millisecond-level cold startup, suitable for high-concurrency, latency-sensitive lightweight services.
Cloud Functions: Deployed on cloud servers, supports Node.js, Python, and Go multiple runtime environments, possesses longer running time and stronger computing power, suitable for complex business logic and data processing.


Getting Started

Under the directory ./edge-functions/api of your project, use the following example code to create your first Edge Function:
export default function onRequest(context) {
return new Response('Hello from Edge Functions!');
}

Under the directory ./cloud-functions/api of the project, use the following example code to create your first Cloud Function:
export default function onRequest(context) {
return new Response('Hello from Cloud Functions!');
}


Difference Between Edge Functions and Cloud Functions

Features
Edge Functions
Cloud Functions
Running location
global edge node
cloud server
cold start time
millisecond-level
Hundred-millisecond level
Latency performance
extremely low
Moderately Low
runtime environment
Edge Runtime
Node.js / Python / Go
Scenarios
High-concurrency, latency-sensitive, short execution time
Complex data processing, extended execution time
For more information, see the referenced document Edge Functions and Cloud Functions.


Function Debugging

1. Install EdgeOne CLI: npm install -g edgeone
2. Local development: Execute edgeone pages dev under the Pages code project to start local service and perform function debugging.
3. Function release: Push code to the remote repository for auto-build and function release.
For more ways to use EdgeOne CLI, see Documentation.
Note:
When debugging Cloud Functions locally, ensure the corresponding runtime environment (Node.js/Python/Go) is installed.


Log Analysis

The Pages console provides basic log viewing functionality. Developers can view basic log information for function calls, quickly detect and resolve anomalies or errors in API calls through logs. For detailed directions, view the document Log Analysis.
ai-agent
你可以这样问我
如何开始使用 EdgeOne Pages?