Hello!
I have an Angular 14 Universal app which I am hosting on Firebase. Everything works as expected EXCEPT the / route...
When getting the / route, I receive the exact index.html file that I have, not rendered (blank page)...
This is my firebase.json:
"functions": [
{
"source": "functions",
"codebase": "default",
"ignore": [...]
}
],
"hosting": {
"public": "functions/browser",
"ignore": [...],
"rewrites": [
{
"source": "**",
"function": "ngssr"
}
]
}
}```
This is my `ngssr` function:
```const functions = require("firebase-functions");
const mainFile = require(__dirname + "/server/main");
exports.ngssr = functions.https.onRequest(mainFile.app());```
This is my `server.ts`:
```...
export function app(): express.Express {
const server = express();
const websiteLocation = environment.production
? "browser"
: "dist/functions/browser";
const distFolder = join(process.cwd(), websiteLocation);
const indexHtml = existsSync(join(distFolder, "index.original.html"))
? "index.original.html"
: "index";
server.engine(
"html",
ngExpressEngine({
bootstrap: AppServerModule,
inlineCriticalCss: false,
})
);
server.set("view engine", "html");
server.set("views", distFolder);
server.get(
"*.*",
express.static(distFolder, {
maxAge: "1y",
})
);
server.get("*", (req, res) => {
console.log("RENDERING", req.path);
res.render(indexHtml, {
req,
providers: [{ provide: APP_BASE_HREF, useValue: req.baseUrl }],
});
});
return server;
}
...
Worth mentioning: I can see the console.log("RENDERING", <ROUTE>) for all routes except the / route.
Any help is very much appreciated. Thank you!