logo

该视频仅会员有权观看

立即开通课程「Next.js 前端应用开发实践」权限。

¥
199
/ 年

理解部署 Next.js 应用

  • In the Ninghao.net rex course, a rx application was deployed which compiles into static resources, such as HTML, CSS, and JavaScript files, and can be hosted on a standard web server.
  • Unlike typical React applications, deploying a Next.js application requires a Node.js environment on the server to handle pre-rendering and image optimization tasks.
  • The Next.js application developed in the course also uses a backend API service, which is locally run using Docker and configured with environment variables for different stages (development and production).
  • When deploying the Next.js app to a server or third-party service, the local API service address must be changed, as it won't work in the production environment.
  • A pre-deployed Node.js application developed by Ninghao.net can be used as the backend API service temporarily if one hasn't deployed their backend service.
  • Before deployment, the Next.js application must be compiled using npx run build and afterwards started with npx run start, which will serve the application suitable for the production environment and the displayed content may differ due to the use of different service interfaces in production.
  • The compiled application resides within the .next directory.