linux azure Web应用程序未显示我的reactjs应用程序 [英] linux azure web app not showing my reactjs app
本文介绍了linux azure Web应用程序未显示我的reactjs应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用npx create-react-app创建了一个Reactjs Web应用程序,并创建了一个天蓝色的ci/cd管道将构建文件夹推送到我的Linux Web应用程序实例.我还指定了启动命令:
pm2服务/home/site/wwwroot --no-daemon --spa
我验证了build文件夹的内容在wwwroot文件夹中,但我的Linux Web应用程序什么也没显示.
我的网络应用程序网址:
对我有用.
I created a Reactjs web app using the npx create-react-app and created an azure ci/cd pipeline to push the build folder to my Linux web app instance. i also specified startup command:
pm2 serve /home/site/wwwroot --no-daemon --spa
I verified that the build folder content is in the wwwroot folder but my Linux web app shows nothing.
my web app url: https://linux--dev.azurewebsites.net/ my web app content:
$ ls /home/site/wwwroot -al
total 37
drwxrwxrwx 2 nobody nogroup 4096 Mar 16 10:21 .
drwxrwxrwx 2 nobody nogroup 0 Mar 16 10:21 ..
-rwxrwxrwx 1 nobody nogroup 1092 Mar 16 10:21 asset-manifest.json
-rwxrwxrwx 1 nobody nogroup 3870 Mar 16 10:21 favicon.ico
-rwxrwxrwx 1 nobody nogroup 3010 Mar 16 10:21 index.html
-rwxrwxrwx 1 nobody nogroup 5347 Mar 16 10:21 logo192.png
-rwxrwxrwx 1 nobody nogroup 9664 Mar 16 10:21 logo512.png
-rwxrwxrwx 1 nobody nogroup 492 Mar 16 10:21 manifest.json
-rwxrwxrwx 1 nobody nogroup 67 Mar 16 10:21 robots.txt
drwxrwxrwx 2 nobody nogroup 0 Mar 16 10:21 static
2021-03-16T11:23:14.156072674Z _____
2021-03-16T11:23:14.156107475Z / _ \ __________ _________ ____
2021-03-16T11:23:14.156112975Z / /_\ \___ / | \_ __ \_/ __ \
2021-03-16T11:23:14.156116975Z / | \/ /| | /| | \/\ ___/
2021-03-16T11:23:14.156120475Z \____|__ /_____ \____/ |__| \___ >
2021-03-16T11:23:14.156124075Z \/ \/ \/
2021-03-16T11:23:14.156127375Z A P P S E R V I C E O N L I N U X
2021-03-16T11:23:14.156130575Z
2021-03-16T11:23:14.156133676Z Documentation: http://aka.ms/webapp-linux
2021-03-16T11:23:14.156136776Z NodeJS quickstart: https://aka.ms/node-qs
2021-03-16T11:23:14.156139976Z NodeJS Version : v14.15.1
2021-03-16T11:23:14.156143076Z Note: Any data outside '/home' is not persisted
2021-03-16T11:23:14.156146376Z
2021-03-16T11:23:14.318873080Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2021-03-16T11:23:14.318893181Z Could not find operation ID in manifest. Generating an operation id...
2021-03-16T11:23:14.318897181Z Build Operation ID: 9baf36d5-1dca-413f-929a-d66115f66772
2021-03-16T11:23:14.845130025Z Environment Variables for Application Insight's IPA Codeless Configuration exists..
2021-03-16T11:23:15.173100881Z Writing output script to '/opt/startup/startup.sh'
2021-03-16T11:23:15.352933180Z Running #!/bin/sh
2021-03-16T11:23:15.369142014Z
2021-03-16T11:23:15.369169414Z # Enter the source directory to make sure the script runs where the user expects
2021-03-16T11:23:15.369175515Z cd "/home/site/wwwroot"
2021-03-16T11:23:15.369179015Z
2021-03-16T11:23:15.369182315Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2021-03-16T11:23:15.369185715Z if [ -z "$PORT" ]; then
2021-03-16T11:23:15.369189115Z export PORT=8080
2021-03-16T11:23:15.369192715Z fi
2021-03-16T11:23:15.369195915Z
2021-03-16T11:23:15.369200215Z PATH="$PATH:/home/site/wwwroot" pm2 serve /home/site/wwwroot --no-daemon --spa
2021-03-16T11:23:15.381752696Z /opt/startup/startup.sh: 11: /opt/startup/startup.sh: pm2: not found
did I miss something?
解决方案
Try to use npx serve -s
in your startup command.
It works for me.
这篇关于linux azure Web应用程序未显示我的reactjs应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文