Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow specifying functions server port for netlify dev via flag #3980

Closed
jiri-matejka opened this issue Jan 8, 2022 · 4 comments · Fixed by #4048
Closed

Allow specifying functions server port for netlify dev via flag #3980

jiri-matejka opened this issue Jan 8, 2022 · 4 comments · Fixed by #4048
Assignees
Labels
area: functions good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality

Comments

@jiri-matejka
Copy link

Is your feature request related to a problem? Please describe.
Every time I start netlify dev, functions run on different port. It makes it hard to create a collection of test requests in tools like Postman, because every time I need to change port number.

Describe the solution you'd like
I propose new parameter --functionsPort that would make possible to specify which port functions server runs on.

Describe alternatives you've considered
None

Can you submit a pull request?
No

@jiri-matejka jiri-matejka added the type: feature code contributing to the implementation of a feature and/or user facing functionality label Jan 8, 2022
@jiri-matejka jiri-matejka changed the title Allow specifying port for functions server for netlify dev Allow specifying functions server port for netlify dev Jan 8, 2022
@tinfoil-knight
Copy link
Contributor

tinfoil-knight commented Jan 11, 2022

@jiri-matejka I think you can configure netlify.toml as follows to get a fixed port:

[dev]
	functionsPort = 8070

Does this work or are you specifically looking for a way to provide the flag through command line?

@jiri-matejka
Copy link
Author

jiri-matejka commented Jan 11, 2022

@tinfoil-knight It works perfectly and is totally acceptable to store it in the file. Closing the issue then.

EDIT: It seems it's not documented (looking at https://docs.netlify.com/configure-builds/file-based-configuration/#netlify-dev), it would be worth documenting, IMO.

@erezrokah
Copy link
Contributor

Re-opening as I think it's good to have as a flag as well + document it

@erezrokah erezrokah changed the title Allow specifying functions server port for netlify dev Allow specifying functions server port for netlify dev via flag Jan 11, 2022
@tinfoil-knight
Copy link
Contributor

@erezrokah Can I take up the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: functions good first issue type: feature code contributing to the implementation of a feature and/or user facing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants