Python Can';t在本地运行Firebase主机时更新change index.html
我是网络开发的新手。我遵循了Firebase团队上传到YouTube上的教程 在将我的项目部署到Cloud Run之后,我能够在Firebase托管本地服务器上运行它https://localhost:5000. 我想更改index.html中的代码,但即使在编辑器(VScode)中更改代码并刷新浏览器后,本地服务器也不会反映更改。现在,我必须运行以下程序来更新本地服务器中的更改,但这确实很耗时Python Can';t在本地运行Firebase主机时更新change index.html,python,firebase,gcloud,firebase-hosting,Python,Firebase,Gcloud,Firebase Hosting,我是网络开发的新手。我遵循了Firebase团队上传到YouTube上的教程 在将我的项目部署到Cloud Run之后,我能够在Firebase托管本地服务器上运行它https://localhost:5000. 我想更改index.html中的代码,但即使在编辑器(VScode)中更改代码并刷新浏览器后,本地服务器也不会反映更改。现在,我必须运行以下程序来更新本地服务器中的更改,但这确实很耗时 $gcloud builds submit --tag gcr.io/ projectName /
$gcloud builds submit --tag gcr.io/ projectName / serviceId
$gcloud run deploy serviceId --region us-central1 --platform managed --image gcr.io/ projectName / serviceId
$node_modules/.bin/firebase serve
是否有任何方法可以让我在Firebase托管本地服务器内部看到index.html中的更改,而无需运行上述代码
项目目录
project
---server
---Dockerfile
---src
---app.py
---templates
---index.html
---static
---styles.css
---icons8-pause.png
---firebase.json
---.firebaserc
---package.json
---node_modules
index.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Flask + Firebase + CLoud Run = FIRE</title>
<link rel="stylesheet" href="/styles.css">
</head>
<body class="full-screen flex-center">
<h1 class="text-xl">FLASK + Firebase = Awesome + Cool + Nice</h1>
<h2>Hello World</h2>
<a href="/my-link/">Click me</a>
<img src="/icons8-pause.png" alt="">
<h3> {{ context.server_time }}</h3>
</body>
</html>
不幸的是,当您将Firebase Hosting与Cloud Run一起使用时,有必要使用这些命令,因为您需要将应用程序容器化并将其上载到容器注册表,以便可以部署它。例如,即使在这种简单的情况下,它也需要运行命令 总之,考虑到应用程序的结构和格式(使用Cloud Run部署),您需要执行命令,这样应用程序才能正确地进行容器化和上载,从而正确地进行部署。您也可以通过官方文档获得所有详细信息
{
"hosting": {
"public": "static",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [{
"source": "**",
"run": {
"serviceId": "serviceId"
}
}]
}
}