stablekernel / aqueduct

Dart HTTP server framework for building REST APIs. Includes PostgreSQL ORM and OAuth2 provider.
https://aqueduct.io
BSD 2-Clause "Simplified" License
2.41k stars 279 forks source link

How to I change aqueduct serve default port? #947

Closed NTMS2017 closed 3 years ago

NTMS2017 commented 3 years ago

How to I change aqueduct serve default port without running "aqueduct serve --port 8889"?

Can I change or configure port to 8889 and just run "aqueduct serve"?

Does plugin has and configuration to change following or should I have to do manually?

In src/cli/commands has defaultsTo:8888 In src/application has int port = 8888; and In src/cli/scripts has final baseUri = document.servers?.first?.url ?? Uri.parse("http://localhost:8888");

jairoFernandez commented 3 years ago

maybe in bin/main.dart in your project

NTMS2017 commented 3 years ago

Thanks, but didnt work. I need to run 2 aqueduct server side by side for 6 months. After migrarion I will delete/shut second one.

jairoFernandez commented 3 years ago

Thanks, but didnt work. I need to run 2 aqueduct server side by side for 6 months. After migrarion I will delete/shut second one.

Are you talking about the scalling? 🧐

cmalbuquerque commented 3 years ago

There are 2 ways to change server configs:

  1. Using flags, if you want to change the port you need to run aqueduct serve --port 8889
  2. Edit configs in bin/main.dart file

If you edit this file, you cannot run 'aqueduct serve' command, you need to run your server through the Dart file doing dart bin/main.dart.

PS: I think you can now close this issue 😁

NTMS2017 commented 3 years ago

Thanks @cmalbuquerque yes I did use aqueduct serve --port 8889 and now I run 2 aqueduct side by side. Thank you.