[英]How do I upload my react app to a web host?
I have created a react js app which works fine when I run it on local server:3000.我创建了一个 react js 应用程序,当我在本地服务器:3000 上运行它时,它运行良好。 I need to run it from the web, have signed up to Heroku, but am now not sure how to do this...
我需要从网上运行它,已经注册了 Heroku,但现在我不知道如何做到这一点......
Please help.请帮忙。
An alternative from heroku: Netlify. heroku 的替代方案:Netlify。 You can create a github repository, push your project in there, then create an account in netlify and upload your project directly from your repository.
您可以创建一个 github 存储库,将您的项目推送到那里,然后在 netlify 中创建一个帐户并直接从您的存储库上传您的项目。 This is by far the easiest option.
这是迄今为止最简单的选择。
You can use您可以使用
npm run build
npm 运行构建
which will create the build files in the build directory.这将在构建目录中创建构建文件。 after that, you can upload the files from the build directory to Heroku / any hosting sites.
之后,您可以将构建目录中的文件上传到 Heroku/任何托管站点。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.