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();
|
2018-07-09 17:38:22 +00:00
|
|
|
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),
|
|
|
|
);
|
|
|
|
app.use(vDir.handleRequest);
|
|
|
|
|
2018-07-09 17:38:22 +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}');
|
|
|
|
}
|