Skip to content

Dynamic content functions redirect in emulators to :5001 port instead of :5000 #3097

Description

@chrisjacobs91

[REQUIRED] Environment info

firebase-tools: 9.1.0

Platform: macOS

[REQUIRED] Test case

  • Setup serving dynamic content with firebase hosting as per firebase documentation (using Express).
  • Trigger a function by navigating in browser to localhost:5000/test
  • Return res.redirect("/destination") at in the express function
  • User navigated to localhost:5001/destination
  • User gets 404 error (expected for localhost:5001/destination as nothing is there)

[REQUIRED] Steps to reproduce

See above

[REQUIRED] Expected behavior

Expect the redirect to use the :5000 port to navigate the user to: localhost:5000/destination
NOTE - when deployed to live, this redirect works fine. Only when operating in the emulator do the ports seem to get muddled up.

[REQUIRED] Actual behavior

Redirects to localhost:5001/destination.

I understand this is because the functions emulator is running at :5001, however production redirects to the hosting path without any issues.

Is there either a fix to be done to the emulator, or a way I can tell express to use :5000 port instead of :5001 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions