我正在尝试将我的 NEXTJS 应用程序部署到 azure。我创建了一个包含安装了 Node 的 linux 操作系统的 web 应用程序。我的package.json看起来像这样。
{
"name": "frontend",
"version": "1.0.0",
"description": "This package contains all necessary depenencies for frontned",
"main": "index.js",
"scripts": {
"dev": "next",
"build": "next build",
"start": "next start -p $PORT",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "masnad",
"license": "ISC",
"dependencies": {
"@zeit/next-css": "^1.0.1",
"next": "^8.0.3",
"react": "^16.8.3",
"react-dom": "^16.8.3"
}
}
Run Code Online (Sandbox Code Playgroud)
我首先创建了一个空的 web 应用程序,然后使用了部署服务 kudu,我将我的代码从本地推送到了 azure。
推送到 azure 时的 git 日志如下所示
remote: ..............................................................
remote: npm …Run Code Online (Sandbox Code Playgroud) 我一直在尝试在 Azure 上部署使用 NextJS 构建的服务器端渲染的 React 应用程序。我设置了 Azure 管道并成功发布,但运行后,当我访问 azure 网站 URL 时,应用程序似乎没有加载。构建文件内容与客户端渲染的应用程序不同。请分享有关部署 SSR React 应用程序(在 Azure 上)的资源或说明。
我使用此资源来设置管道,没有遇到错误,但 URL 仍然未加载应用程序。
reactjs server-side-rendering azure-web-app-service azure-pipelines next.js