简体   繁体   English

如何将我的 React 应用上传到网络主机?

[英]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.

相关问题 在本地主机上重新启动计算机后,如何再次打开我的 React 应用程序? - How do I open my React app again after restarting my computer on local host? 如何在 Github 页面上托管我的 React 应用程序而不会被重定向? - How do I host my React app on Github pages without getting redirected? 我如何在 IIS web 服务器中托管反应应用程序? - how can i host react app in IIS web server? 我如何从反应 web 应用程序将文件上传到 azure blob? - how do i upload file to azure blob from react web app? 如何在 cPanel 中托管 Laravel 和 Inertiajs (React) 应用程序? - How do I host Laravel and Inertiajs (React) app in cPanel? 我如何调用我的变量以便它显示在我的反应网络应用程序上 - how do i call my variable so that it shows up on my react web app 如何在AWS上上传我的React api应用程序? - How can I upload my React api app on AWS? 我如何使用像loglevel这样的库来登录我的react / redux Web应用程序 - How can i use a lib like loglevel to do logging in my react/redux web app 如何根据变量的输出在我的 React Web 应用程序中设置组件的宽度 - How do I set the width of a component in my React web-app based off the output of a variable 如何部署 React 应用并将其上传到 Hostinger? - How do I deploy and upload a React App to Hostinger?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM