angular - 在单个 Firebase 项目上托管多个 Angular 项目
问题描述
我正在考虑在一个 Firebase 项目下托管一个包含多个 Angular 项目的投资组合网站(例如https://aaaaa.firebaseapp.com/)。所以说我有 3 个角度应用程序(abc、def 和 ghi)。我将在单个投资组合登录页面上显示它们并在 firebase 上托管。
例如https://aaaaa.firebaseapp.com/abc
https://aaaaa.firebaseapp.com/def
https://aaaaa.firebaseapp.com/ghi
这怎么可能?请建议。
解决方案
Firebase 托管支持每个项目拥有多个站点。然后,您可以将每个站点配置为在路径下提供服务。
{
"hosting": [ {
"target": "blog", // "blog" is the applied target name for the Hosting site "myapp-blog"
"public": "blog/dist", // contents of this folder are deployed to the site "myapp-blog"
// ...
},
{
"target": "app", // "app" is the applied target name for the Hosting site "myapp-app"
"public": "app/dist", // contents of this folder are deployed to the site "myapp-app"
// ...
"rewrites": [...] // You can define specific Hosting configurations for each site
}
]
}
https://firebase.google.com/docs/hosting/multisites#define_hosting_config
推荐阅读
- java - 需要一种方法来获取与 List.stream().anyMatch() 匹配的字符串中的模式
- javascript - javascript输出中的箭头函数?
- jmeter - JMeter - websocket插件 - 禁止错误
- import - 加载本地图像 React
- sql - SQL | 斯卡拉 | 乔克 | 表包含 Array[Long] 和 Long | 从具有 Long 行的数组中获取一对值
- java - 如何使用 RestEasy 实现 HTTP PATCH 调用
- python - 在哪种情况下会使用另一个矩阵而不是单位矩阵来查找特征值?
- php - 如何正确地将数据添加到数组中
- c++ - 挂起的线程时间
- reactjs - React useState not rendering with objects