如何在Github gh页上托管React App

时间:2020-04-25 14:40:29

标签: reactjs github github-pages

我在获取基本的React应用程序时遇到问题,因此它显示为Github页面,它似乎总是落在一组指令上。我一直在尝试解决过去的3天中的此问题,无论我阅读了什么文档和遵循的步骤似乎都能提供相同的结果。 到目前为止,我发现的最佳指令集是:https://www.pluralsight.com/guides/deploying-github-pages-with-create-react-app

您将在此处找到该存储库: https://github.com/guillaumelauzier/my-app

此处是应用页面: https://guillaumelauzier.github.io/my-app/

我在做荣吗?通过执行npm start,所有人似乎都可以在我的本地主机上正常工作,我使用以下命令推送了所有文件:

echo "# my-app" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:guillaumelauzier/my-app.git
git push -u origin master

我在GH-Pages上托管的React应用程序上阅读的所有stackoverflow帖子似乎都没有一个确定的解决方案。非常感谢您的帮助,因为我需要在星期一之前启动并运行它。

1 个答案:

答案 0 :(得分:0)

我经历了https://pages.github.com/,发现您需要从github存储库设置中为index.html文件设置文件夹。

希望这会有所帮助:https://help.github.com/en/github/working-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site

enter image description here

相关问题