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 operations such as purchasing a server. The deployed Nuxt.js application can use the auto scaling, pay-as-you-go, and O&M-free features of Function Compute.
- Install Funcraft. For more information, see Install Funcraft.
- Configure Funcraft. For more information, see Configure Funcraft.
The content about how to use Funcraft to migrate an application from a traditional framework is no longer maintained. We recommend that you use Serverless Devs to migrate relevant frameworks to Function Compute.
For more information about how to migrate Function Compute-related resources from Funcraft to Serverless Devs, see Migrate resources from Funcraft to Serverless Devs.
For more information about how to use Serverless Devs to migrate an application from a web framework, see Use Serverless Devs to migrate web frameworks.
We apologize for any inconvenience caused.
Nuxt.js is a general application framework based on Vue.js. Nuxt.js abstracts away the client-server architecture and focuses on user interface rendering for applications. Nuxt.js has preset all the configurations required to develop server-side rendered (SSR) Vue.js applications. It provides a large number of useful features for the client-server application architecture, such as asynchronous data loading, middleware support, and layout support.
- Run the following command to create a Nuxt.js project.
npx create-nuxt-app <project-name>Note If a Nuxt.js project already exists, skip this step.
- Open the sample project or an existing project.
- Install dependencies.
- Run the on-premises project.
yarn devThe following result is returned.
- Run the following command to compile the Nuxt.js project:
- Run the
fun deploy -ycommand to deploy the application to Function Compute.Note If the template.yml file cannot be added, update Funcraft to the latest version.After the application is deployed, you can check the logs to find the temporary domain name that is generated by Function Compute. 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. You must use a domain name that has obtained an Internet Content Provider (ICP) filing from Alibaba Cloud for production. For more information, see Configure a custom domain name.