I have created two Flutter applications. The first is Android app and contains an HTTP server that I want to use to serve this application via a web page. The second is Flutter web application. I built the second application and thanks to that I got files like index.html, main.dart.js and others. I would like to add these files to the first application so that when the HTTP server is turned on and the correct web page is loaded with the appropriate IP and port, this second application will be displayed. Is this possible? I have added these files to the assets folder, I have also added them to pubspec.yaml. I created a function that reads the index.html and sends it to the client using request.response.write.
Future<void> showWeb(HttpRequest request) async {
String _content = await rootBundle.loadString('assets/files/web/index.html');
request.response
..statusCode = HttpStatus.ok
..headers.set("Content-Type", "application/javascript; charset=utf-8")
..write(_content)
..close();
}
I put "text/html" as the header, which throws me an error "content type mismatch". When I add "application/javascript" as a header, I get the source code of the html file.
Is it possible to view the Flutter web app using an HTTP server?

Is it possible to view the Flutter web app using an HTTP server?I do not understand that question. Your http server serves a html file from assets. You can check if your server does its job from any browser on that device or any browser on devices in the same network.put the generated files (html, etc) into the first application that displays them on the given port.I cannot follow you. The first application serves those files. It will display nothing. The browser displays.