我可以使用 React 创建子域应用程序吗?
我有一个 WordPress 网站,它是 live example.com。我想创建一个像 Airbnb 一样简单的度假租赁预订系统应用程序,但没有那么先进。我想使用 React 创建这个,我的问题是我可以在子域(例如 booking.example.com)上创建一个 React 应用程序吗?这样做会有什么问题吗?根据我所读到的内容,我需要创建一个自定义帖子类型,然后发出 axios 请求以从数据库中提取数据,对于帖子请求也是如此。
或者,我是否可以创建反应应用程序并将其嵌入到单页面模板中?我希望人们能够创建一个帐户,发布自己的出租房产并付款才能列出它。
I have a wordpress site which is live example.com. I want to create a simple holiday rental booking system application like Airbnb but not as advanced. I would like to create this using react, my question is can I create a react application on a subdomain e.g booking.example.com and would there be any problems in doing it that way? From what I have read, I would need to create a custom post type and then make axios requests to pull the data from the database and also the same for post requests.
Alternatively could I potentially create the react application and embed it on a single page template? I want people to be able to create an account, post their own rental properties and pay in order to list it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,你可以在你的服务器上安装 React、npm。
如果您使用的是 Apache 或 Cpanel,那么您可以在 React 应用程序子域根目录中创建 .htaccess 文件。
您将根据您的要求更改端口。
问候
Yes, you can install React,npm on your server.
If you are using Apache or Cpanel, then you can create .htaccess file on your react app subdomain root directory.
Make are you will change the PORT according to your requirements.
Regards