So I have an angular 5 application deployed under firebase hosting with domain www.mydomain.com. Now I have one more angular 5 application connecting to the same project and I would be treating this as admin panel and would like to deploy under a subdomain - www.admin.mydomain.com
I have properly configured my TXT
records for respective domains and when I hit both the URLs
it is going to display first project contents.
My firebase.json
for the first application is as follow:
{
"hosting": {
"public": "dist",
"ignore": [
"firebase.json",
"**/.*",
"**/node_modules/**"
],
"rewrites": [{
"source": "**", //for any route request
"destination": "/index.html"
},
{
"source": "https://admin.mydomain.com/**", //specific to this request
"destination": "/admin/index.html"
}
]
}
}
The second application's build output directory will be within the first application's dist directory and both the projects are in same level in my system.
second app's angular-cli.json
contains "outDir": "../firstapp/dist/admin",
So once both are built and place within dist
directory of the first project's application and I've successfully deployed the same.
But still, when I browse 2 different URLs it always serves pages from the first application and admin
directory under dist
folder is never considered.
The built version of the project has below structure
-dist
-admin
-index.html
-inline.370847efdcd50e26c23c.bundle.js
-main.ff340c7513400e78d233.bundle.js
-polyfills.32225f5d64cec6731cb0.bundle.js
-styles.d41d8cd98f00b204e980.bundle.css
-index.html
-inline.09d20b30b3c5121cfc56.bundle.js
-main.c97b32660a6d046955c8.bundle.js
-polyfills.1364aed46b3c77673c40.bundle.js
-styles.2926c591943e8077f48a.bundle.css
I am under the impression that below rewrite entry will make sure to serve contents from admin
directory under dist
directory for all the requests from admin.mydomain.com
.
"source": "https://admin.mydomain.com/**", //specific to this request
"destination": "/admin/index.html"
Could someone please clarify what am presuming or doing wrong here and how I can achieve this?