Skip to content

Support process.env.PORT for ng serve #32236

@annajowang

Description

@annajowang

Command

serve

Description

This is supported by nextjs: https://nextjs.org/docs/app/api-reference/cli/next#next-dev-options

The use case is for the firebase emulator where we want to serve both nextjs and angular apps at specific ports determined by our emulator.

If ng serve just supported process.env.PORT then the implementation is simple and everything works as expected.

Currently, without PORT support in ng serve, we have some imperfect hack where we:

(Filing this for tracking purposes only and to link to discussions in issues and PRs. We're also going to better document the caveats above in our own user docs)

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions