Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
- Improve Firebase Data Connect postgres security by granting fine grained SQL privileges to the users the need it. (#7578)
- Remove `dataconnect:sql:migrate` command hard dependency on 'roles/cloudsql.admin'. (#7578)
- Add support for setting the encryption configuration of restored firestore databases (#7483)
- Fix (Angular 17+) temporary change the PORT in Angular server.ts (#6651)

22 changes: 17 additions & 5 deletions src/frameworks/angular/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,23 @@ exports.handle = function(req,res) {
});
};\n`;
} else if (serverOutputPath) {
bootstrapScript = `const app = ${
serverEntry?.endsWith(".mjs")
? `import(\`./${serverOutputPath}/${serverEntry}\`)`
: `Promise.resolve(require('./${serverOutputPath}/${serverEntry}'))`
}.then(server => server.app());
bootstrapScript = `
const app = new Promise((resolve) => {
setTimeout(() => {
const port = process.env.PORT;
const socket = 'express.sock';
process.env.PORT = socket;

${
serverEntry?.endsWith(".mjs")
? `import(\`./${serverOutputPath}/${serverEntry}\`)`
: `Promise.resolve(require('./${serverOutputPath}/${serverEntry}'))`
}.then(({ app }) => {
process.env.PORT = port;
resolve(app());
});
}, 0);
});
exports.handle = (req,res) => app.then(it => it(req,res));\n`;
} else {
bootstrapScript = `exports.handle = (res, req) => req.sendStatus(404);\n`;
Expand Down