I just started learning dart, and what I wanted to do as practice is to serve the default web application with a simple webserver. I store the server at E:\DartProject\server
and the web client at E:\DartProject\WebClient
. Unfortunately I can't get the server to serve the webapp. The code for the webserver is
import 'dart:io';
import 'package:http_server/http_server.dart' show VirtualDirectory;
VirtualDirectory virDir = new VirtualDirectory("E:\DartProject\WebClient\web");
void main() {
HttpServer.bind(InternetAddress.ANY_IP_V4, 80).then((server) {
print("Serving at ${server.address}:${server.port}");
server.listen((request) {
virDir.serveRequest(request);
});
});
}
I'm always getting 404 errors. What do I do wrong?