This topic describes how to deploy a Nuxt.js application to Function Compute. Function Compute provides a method different from traditional deployment methods. You can deploy a traditional Nuxt.js application to Function Compute and use the application for production without performing steps such as purchasing a machine. Your Nuxt.js application can use the auto-scaling, pay-as-you-go, and O&M-free features of Function Compute.
Nuxt.js is a general-purpose application framework based on Vue.js. It abstracts away the client-server architecture and focuses on user interface rendering for applications. Nuxt.js has preset all the configurations needed to develop server-side rendered (SSR) Vue.js applications. It provides many useful features for the client-server application architecture, such as asynchronous data loading, middleware support, and layout support.
Step 1: Prepare the environment
You do not need to install Docker but only Funcraft. The easiest way to install Funcraft is to download the executable binary files.
Step 2: Migrate the application
- Run the following command to create a Nuxt.js project. If you already have a Nuxt.js
project, skip this step.
npx create-nuxt-app <project-name>
- Run the following command to open the sample application or an existing application:
- Run the following command to install dependencies:
- Run the following command to run the on-premises application:
yarn devThe following results are returned:
- Run the following command to compile the Nuxt.js project:
- Run the
fun deploy -ycommand to deploy the application to Function Compute.
Funcraft automatically begins to deploy the application.Note If the .yml file cannot be added, update Funcraft to the latest version.After the project is deployed, check the log to find the temporary domain name that Function Compute generated. You can use this temporary domain name to access the deployed application.Note The temporary domain name is used only for demonstration and development purposes. It is valid for a limited period of time. To use an application in a production environment, you must bind the application to a domain name that has obtained an Internet Content Provider (ICP) filing from Alibaba Cloud. For more information, see Bind a custom domain name.