Skip to main content

Development Framework Guide

CloudBase HTTP cloud functions support multiple mainstream Web development frameworks, enabling you to rapidly build and deploy Web applications using familiar technology stacks. This guide introduces various supported frameworks and their characteristics to help you choose the most suitable development solution for your project requirements.

Supported Development Frameworks

JavaScript/TypeScript Frameworks

Framework Features Comparison

FrameworkTypeLearning CurveApplicable ScenariosKey Features
Express.jsMicro-frameworkGentleAPI services, small applicationsLightweight, flexible, rich middleware
NestJSEnterprise-level frameworkModerateLarge-scale backend applicationsTypeScript, dependency injection, modularity
Next.jsFull-stack frameworkModerateFull-stack applications, SSR applicationsReact, SSR/SSG, API routes

Python Frameworks

Framework Features Comparison

FrameworkTypeLearning CurveApplicable ScenariosKey Features
DjangoFully-featured frameworkModerateComplex Web applicationsORM, Admin backend, comprehensive ecosystem
FlaskMicro-frameworkGentleAPI services, small applicationsLightweight, flexible, extensible
FastAPIModern frameworkGentleHigh-performance APIsAsynchronous, type checking, automatic documentation

How to Choose a Framework

Select Based on Project Requirements

🚀 Rapid Prototyping

  • Recommended: Express.js, Flask
  • Reasons: Gentle learning curve, fast development speed, suitable for quickly validating ideas

🏢 Enterprise-Grade Applications

  • Recommended: NestJS, Django
  • Reasons: Complete architecture, strong maintainability, suitable for team collaborative development

🌐 Full-Stack Applications

  • Recommended: Next.js
  • Reasons: Integrated frontend-backend, supports SSR/SSG, suitable for modern Web applications

⚡ High-Performance API

  • Recommended: FastAPI, Express.js
  • Reasons: Excellent performance, asynchronous support, suitable for high-concurrency scenarios

Select Based on Team Skills

JavaScript/TypeScript Team

  • Preferred: Express.js (for simple projects), NestJS (for complex projects), Next.js (for full-stack projects)
  • Advantages: Unified tech stack, reduces the learning curve

Python Team

  • Preferred: Flask (simple projects), Django (complex projects), FastAPI (API projects)
  • Advantages: Leverages the existing Python ecosystem and expertise

Deployment Requirements

All frameworks must meet the following requirements when deployed on CloudBase HTTP cloud functions:

General Requirements

  • Port Configuration: The application must listen on port 9000
  • Startup Script: The scf_bootstrap startup script must be provided.
  • Runtime: Node.js 16.13+, Python 3.8+, and other supported runtime versions
  • Memory Limit: Select an appropriate memory configuration (128MB-3008MB) based on application complexity

Configuration Example

Node.js Application scf_bootstrap

#!/bin/sh
export PORT=9000
export NODE_ENV=production
npm start

Python Application scf_bootstrap

#!/bin/sh
export PORT=9000
python app.py