start static method
Start the app of config in this isolate and give a client for it.
It runs the services (eg. the ORM service) and registers the routes,
like the real start. It always listens on 127.0.0.1 and a free
port, and runs one isolate. serverPort and totalIsolate of
config are not used.
Implementation
static Future<DoxTestClient> start(AppConfig config) async {
Dox dox = Dox();
dox.initialize(config);
dox.addServices(config.services);
await dox.startServices();
DoxServer server = DoxServer();
server.setResponseHandler(config.responseHandler);
HttpServer http = await server.listen(
0,
address: InternetAddress.loopbackIPv4,
);
return DoxTestClient(Uri.parse('http://127.0.0.1:${http.port}'));
}