我的痛苦点是,我必须在本地并手动生成新的HTML页面文件,并在用户创建新内容时部署它们。
我正在寻找的是,当用户创建新内容时,将在firebase托管中自动生成新的HTML文件并为其提供一个路径URL。
假设
1-我有这个网站: www.example.com
2-用户创建新评论后,例如“ Hello Firebase Hosting”。
3-我想生成 html文件基础在firebase内部的评论托管没有 重新启动一个新版本,以附加最新评论。
4-最新的评论生成的文件必须为此url wwwww.example.com/hello_firebase.com/hello_firebase_hostin.html < /a>
5- www.example.com/hello_fire_firebase_hostin.hostin.hostin.html 可以在创建后立即访问。
谢谢,,,
My pain point is I have to locally and manually generate the new HTML pages file and deploy them every time users create new content.
What I am looking for is when users create new content automatically generate the new HTML file in the Firebase Hosting and give it a path URL.
Let's say
1 - I have this website: www.example.com
2 - After a user creates a new comment for example "Hello Firebase Hosting".
3 - I want to generate the HTML file base on that comment inside firebase hosting without redeploying a new version to attach the newest comment.
4 - newest comment generated file must be as this URL www.example.com/Hello_Firebase_Hostin.html
5 - www.example.com/Hello_Firebase_Hostin.html can be accessed immediately after being created.
Thanks,,,
发布评论
评论(1)
如果不部署新的 HTML 页面(或其他文件),则无法在 Firebase 托管上创建它们。
您可以做的是调用 Firebase Hosting REST API 来仅部署新文件。我之前在这里回答过这个问题:我可以向我的 Firebase 托管静态网站添加其他文件吗?还是每次都必须部署整个网站?,以及此处有一个 Gist 及其基本代码。
不过,更常见的方法是将 Firebase Hosting 与 Cloud Functions 或 Cloud Run 连接,然后在那里生成动态内容。有关详细信息,请参阅有关提供动态内容和托管微服务的 Firebase 文档。
There is no way to create new HTML pages (or other files) on Firebase Hosting without deploying them.
What you can do is call the Firebase Hosting REST API to deploy just the new file(s). I've answered about this before here: Can I add additional file to my Firebase hosted static website, or must I deploy the entire site every time?, and there's a Gist with the basic code for it here.
The more common approach though is to connect Firebase Hosting with Cloud Functions or Cloud Run and then generate the dynamic content there. For more on this, see the Firebase documentation on serving dynamic content and hosting microservices.