Skip to content

Commit 8f2f002

Browse files
Merge pull request #27 from contentstack/CL-1573
feat: Enable setting port using PORT environment variable when running cloud functions
2 parents 6411c2c + 5420443 commit 8f2f002

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/commands/launch/functions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ export default class Functions extends Command {
2929
const currentWorkingDirectory = process.cwd();
3030
const projectBasePath = flags['data-dir'] || currentWorkingDirectory;
3131

32-
await new Contentfly(projectBasePath).serveCloudFunctions(+flags.port);
32+
const port = process.env.PORT || flags.port;
33+
34+
await new Contentfly(projectBasePath).serveCloudFunctions(port);
3335
}
3436
}

0 commit comments

Comments
 (0)