hotReload function
Implementation
void hotReload(Future<HttpServer?> Function() createServer) {
runZonedGuarded(
() {
HotReload(
serverFactory: () async {
try {
return await createServer();
} catch (e, st) {
// ignore: avoid_print
print('Failed to create server\n$e\n$st');
}
return null;
},
).attach().ignore();
},
(error, stack) {
// ignore: avoid_print
print('Failed to create server (uncaught)\n$error\n$stack');
},
);
}