As we all know Flutter is great for the front end, as I got into working with flutter I liked the Dart programming language very much I used it on some backend servers as well, Now it got me thinking if I can do this..
I have a aqueduct server (Aqueduct is a dart package, which is very similar to express on node.js)
import 'dart:async';
import 'dart:io';
import 'package:aqueduct/aqueduct.dart';
import 'package:aqueduct/managed_auth.dart';
Future main() async {
final app = Application<App>()
..options.configurationFilePath = 'config.yaml'
..options.port = 8888;
await app.start(numberOfInstances: 3);
}
class App extends ApplicationChannel {
//server side logic
}
will the server/app be successfully built if I make the above main() as the entry point of the flutter app, successfully making the flutter app running on the android device to act as a server?
Or
how can I make it work if the above code fails?
PS: I have not tried this yet. for your information: a node.js express server can be (may be) run on android using Node.js ARM