platform/example/main.dart

20 lines
555 B
Dart
Raw Normal View History

2017-11-18 06:12:59 +00:00
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_static/angel_static.dart';
import 'package:file/local.dart';
main() async {
var app = new Angel();
var http = new AngelHttp(app);
2017-11-18 06:12:59 +00:00
var fs = const LocalFileSystem();
var vDir = new VirtualDirectory(
app,
fs,
allowDirectoryListing: true,
source: fs.directory(fs.currentDirectory),
);
2018-08-28 14:58:28 +00:00
app.fallback(vDir.handleRequest);
2017-11-18 06:12:59 +00:00
var server = await http.startServer('127.0.0.1', 3000);
2017-11-18 06:12:59 +00:00
print('Listening at http://${server.address.address}:${server.port}');
}