startServer function
Implementation
Future<HttpServer> startServer(String html, int port) async {
final server = await HttpServer.bind('127.0.0.1', port);
server.listen((req) async {
req.response.headers.add('Content-Type', 'text/html');
req.response.write(html);
req.response.close();
});
return server;
}