Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2278)

Unified Diff: dart/samples/dartiverse_search/bin/server.dart

Issue 68633002: Version 1.0.0.2 (Closed) Base URL: http://dart.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dart/editor/build/promote.py ('k') | dart/samples/dartiverse_search/web/client.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/samples/dartiverse_search/bin/server.dart
===================================================================
--- dart/samples/dartiverse_search/bin/server.dart (revision 30146)
+++ dart/samples/dartiverse_search/bin/server.dart (working copy)
@@ -116,6 +116,23 @@
var indexUri = new Uri.file(dir.path).resolve('index.html');
virDir.serveFile(new File(indexUri.toFilePath()), request);
};
+
+ // Add an error page handler.
+ virDir.errorPageHandler = (HttpRequest request) {
+ log.warning("Resource not found ${request.uri.path}");
+ request.response.statusCode = HttpStatus.NOT_FOUND;
+ request.response.close();
+ };
+
+ // Serve everything not routed elsewhere through the virtual directory.
virDir.serve(router.defaultStream);
+
+ // Special handling of client.dart. Running 'pub build' generates
+ // JavaScript files but does not copy the Dart files, which are
+ // needed for the Dartium browser.
+ router.serve("/client.dart").listen((request) {
+ Uri clientScript = Platform.script.resolve("../web/client.dart");
+ virDir.serveFile(new File(clientScript.toFilePath()), request);
+ });
});
}
« no previous file with comments | « dart/editor/build/promote.py ('k') | dart/samples/dartiverse_search/web/client.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698