Skip to main content

Next Plugins

Tencent CloudBase Framework Next SSR Plugin

Tencent CloudBase Framework Next SSR Plugin

Github License Npm version issue PRs Welcome star star

CloudBase Framework "Next SSR" Plugin: Deploy Next SSR applications to the CloudBase environment with one click via the CloudBase Framework, delivering a high-performance Node SSR application service featuring automatic elastic scaling. It integrates seamlessly with other plugins such as the Website plugin and Function plugin to enable cloud-native integrated development.

Features

  • Free from concerns about the underlying architecture: Just focus on developing business services without adapting to functions or containers
  • Cost Savings: Achieves significant resource cost reduction through resource scaling, elastic scaling, and flexible billing.
  • Framework Support: Seamlessly supports projects built with the Next framework.

Usage

Step 1. Preparations

Specific steps please refer to Preparing the Cloud Development Environment and CloudBase CLI Command Tool

Step 2. Enter the Next project directory and initialize

If you have an existing Next application project

cloudbase

If you want to start a new project from scratch, you can directly execute init to begin a project from a template.

cloudbase init

Step 3. One-Click Deployment

cloudbase framework deploy

Configuration

By default, no configuration is required for use. The following configuration parameters are intended for scenarios with specific requirements.

Configuration Example

After running cloudbase init, the Cloud Development configuration file cloudbaserc.js` will be created. You can write plugin configurations in the plugins section of the configuration file.

{
"envId": "{{envId}}",
"framework": {
"plugins": {
"client": {
"use": "@cloudbase/framework-plugin-next",
"inputs": {
"entry": "./",
"path": "/next-ssr",
"name": "next-ssr",
"buildCommand": "npm run build"
}
}
}
}
}

entry

Default ./

The directory for the Next configuration file, by default the current project directory.

path

Access the subpath, such as /next-ssr

name

Service name, such as next-ssr

buildCommand

Build command, such as npm run build, can be omitted if not required.

functionOptions

Optional. Supported since version 1.3.7, allowing customization of more advanced settings such as VPC environment variables.

Example:

{
"use": "@cloudbase/framework-plugin-next",
"inputs": {
"path": "/next-ssr",
"name": "next-ssr",
"functionOptions": {
"timeout": 5,
"envVariables": {
"TEST_ENV": 1
},
"vpc": {
"vpcId": "xxx",
"subnetId": "xxx"
}
}
}
}

For specific configuration information, please refer to the @cloudbase/framework-plugin-function configuration.

More Plugins

Please visit the CloudBase Framework Plugin List to use other plugins in combination

Documentation Resources