Skip to main content

Development Notes

Programming Language Support

Regular Cloud Function

LanguageVersionRecommended ScenariosFeatures
Node.js20.19, 18.15, 16.13Web APIs, data processingRich ecosystem, high development efficiency
Python3.10, 3.9, 3.7Data analysis, AI/MLRich scientific computing libraries
PHP8.0, 7.4Web development, CMSTraditional strengths in Web development
GoLatest versionHigh-performance services, system toolsExcellent performance, strong concurrency capabilities
Java11 (Kona JDK)Enterprise applications, big dataMature ecosystem, stable performance

HTTP cloud function

LanguageVersionRecommended FrameworkApplicable Scenarios
Node.js20.19, 18.15, 16.13Express, NestJS, Next.jsFull-stack applications, API services
Python3.10, 3.9, 3.7Django, Flask, FastAPIWeb applications, data APIs
PHP8.0, 7.4Laravel, SymfonyTraditional Web applications
GoLatest versionGin, Echo, FiberHigh-performance API services
Java11 (Kona JDK)Spring Boot, QuarkusEnterprise-level Web services

Development Environment Preparation

Local Development Environment

Node.js Development Environment

# Install Node.js (recommend using nvm to manage versions)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
nvm install 20.19.0
nvm use 20.19.0

# Verify installation
node --version
npm --version

Python Development Environment

# Install Python (recommend using pyenv to manage versions)
curl https://pyenv.run | bash
pyenv install 3.10.0
pyenv global 3.10.0

# Create a Virtual Environment
python -m venv cloudbase-env
source cloudbase-env/bin/activate # Linux/macOS
# cloudbase-env\Scripts\activate # Windows

# Verify installation
python --version
pip --version

Development Tools

Through this guide, you should have learned the core concepts and best practices of CloudBase cloud function development. It is recommended to start with simple examples to gradually master the development and deployment process of cloud functions.