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

auto get available port in dev #92

Closed
await-ovo opened this issue Jul 12, 2022 · 2 comments · Fixed by #95
Closed

auto get available port in dev #92

await-ovo opened this issue Jul 12, 2022 · 2 comments · Fixed by #95
Labels

Comments

@await-ovo
Copy link
Contributor

Is your feature request related to a problem? Please describe.
image

Currently, if port 1234 is occupied, an error is thrown directly, but there is no way to change the port.

Describe the solution you'd like

  • There should be a way to specify the port when dev, for example lagon dev --port 8000
  • Ability to automatically get available port(get-port-please)
@QuiiBz
Copy link
Member

QuiiBz commented Jul 12, 2022

Good idea. We could also add the --host(name?) option, which currently defaults to localhost.

But not sure about adding another dependency for ports, it should be easily feasible. Next.js does it in a few lines of code: https://github.com/vercel/next.js/blob/9342a6ccc7f59e5de481577be61859cf5372be0e/packages/next/server/lib/start-server.ts#L26

@await-ovo
Copy link
Contributor Author

Good idea. We could also add the --host(name?) option, which currently defaults to localhost.

But not sure about adding another dependency for ports, it should be easily feasible. Next.js does it in a few lines of code: https://github.com/vercel/next.js/blob/9342a6ccc7f59e5de481577be61859cf5372be0e/packages/next/server/lib/start-server.ts#L26

Looks good, I can submit a pr later~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants