我的渡槽服务器的main.dart文件是
import 'package:dart_server/dart_server.dart';
Future main() async {
final app = Application()
..options.configurationFilePath = "config.yaml"
..options.port = 3000; // changed from 8888
final count = Platform.numberOfProcessors ~/ 2;
await app.start(numberOfInstances: 1); // changed from count > 0 ? count : 1
print("Application started on port: ${app.options.port}.");
print("Use Ctrl-C (SIGINT) to stop running the application.");
}
我更改了端口号和实例数,但是当我使用启动服务器时
aqueduct serve
我仍然获得端口8888和两个实例:
-- Aqueduct CLI Version: 3.1.0+1
-- Aqueduct project version: 3.1.0+1
-- Preparing...
-- Starting application 'dart_server/dart_server'
Channel: DartServerChannel
Config: /Users/jonathan/Documents/Programming/Tutorials/Flutter/backend/backend_app/dart_server/config.yaml
Port: 8888
[INFO] aqueduct: Server aqueduct/1 started.
[INFO] aqueduct: Server aqueduct/2 started.
仅当我像这样显式启动服务器时
aqueduct serve --port 3000 --isolates 1
我是否获得端口3000和一个实例:
-- Aqueduct CLI Version: 3.1.0+1
-- Aqueduct project version: 3.1.0+1
-- Preparing...
-- Starting application 'dart_server/dart_server'
Channel: DartServerChannel
Config: /Users/jonathan/Documents/Programming/Tutorials/Flutter/backend/backend_app/dart_server/config.yaml
Port: 3000
[INFO] aqueduct: Server aqueduct/1 started.
为什么更改main.dart不会对其产生影响? (我在进行更改后保存了文件。)是否还有其他地方需要进行更新?