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.
- Install Funcraft on the local machine. For more information, see Install Funcraft.
- Run the
fun --versioncommand to check whether the installation is successful.
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 project or an existing project:
- Run the following command to install dependencies:
- Run the following command to run the local project:
yarn devThe following results are returned:
- Run the following command to compile the Nuxt.js project:
- Run the
fun deploy -ycommand to deploy the project to Function Compute.
Funcraft automatically begins to deploy the project.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 only for a limited time. To use an application in a production environment, you must bind a domain name that has been filed with Alibaba Cloud. For more information, see t1881050.html#multiTask2940.