我可以使用 cpanel 将我的 React Native 应用托管到我的网站吗?

Can I host my React Native app to my website using cpanel?

我目前正在使用 React Native 开发一个网站,当我阅读有关 React Native 的信息时,我了解到 React Native 可以同时用作 Web 应用程序和移动应用程序,所以我尝试了它。

目前,我的网站已经完成,可以运行在localhost

但现在我想使用 Cpanel 托管网站时遇到问题。

之前我想问一下,React Native 可以作为网站托管吗?

是的,您可以在 cPanel 上托管您的 ReactNative 应用程序。请关注这个link https://dev.to/crishanks/deploy-host-your-react-app-with-cpanel-in-under-5-minutes-4mf6

运行 在您的项目中执行以下命令

 expo build:web

它将生成 web-build 文件夹。在构建文件夹中,所有静态、资产、js 和 html 文件都位于其中。

  • 现在是时候将您的静态文件上传到 c-panel

打开您的 c-panel 帐户并进入文件管理器和 select 您想要使用 web-build (react-native-web) 的域。

将 web-build 的文件夹内容上传到您的文件夹,这需要几分钟时间,您可以访问您的域,您的网站将在特定域上运行