[英]How and where do I deploy a Flask + React web app?
I am building a web app with a Flask backend and a React front end, and I would now like to deploy it, buy a domain, and set it up.我正在构建一个带有 Flask 后端和 React 前端的 web 应用程序,我现在想部署它,购买域并进行设置。 What is the easiest way to do this?最简单的方法是什么?
Here's my research:这是我的研究:
Is there an easy way to deploy to a reliable service (Google Cloud/AWS/Azure)?有没有一种简单的方法可以部署到可靠的服务(谷歌云/AWS/Azure)? My code has the following structure:我的代码具有以下结构:
build/ # Result of `yarn build`
server/
server.py # Flask server
src/ # React code
Component/
Component.js
Component.sass
index.css
index.js
...
public/
index.html
# Images and other stuff.
I figured out how to do this using Azure. I created an App Service, then installed the Azure Tools VS Code extension.我想出了如何使用 Azure 来做到这一点。我创建了一个应用服务,然后安装了 Azure 工具 VS 代码扩展。 You need to move the Python server to the root directory and rename it to app.py
(so the .env
is also in the root folder), and then you can right-click your App Service in VS Code (in the Azure Tools tab) and then click Deploy to Web App.你需要将 Python 服务器移动到根目录并重命名为app.py
(所以.env
也在根文件夹中),然后你可以在 VS Code 中右键单击你的 App Service(在 Azure 工具选项卡中) 然后单击部署到 Web 应用程序。 Easy!简单的!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.