| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #library('server'); | 5 library http_server; |
| 6 #import('dart:io'); | 6 import 'dart:io'; |
| 7 #import('../../pkg/args/lib/args.dart'); | 7 import '../../pkg/args/lib/args.dart'; |
| 8 | 8 |
| 9 /** A simple HTTP server. Currently handles serving static files. */ | 9 /** A simple HTTP server. Currently handles serving static files. */ |
| 10 class HttpTestServer { | 10 class HttpTestServer { |
| 11 HttpServer server; | 11 HttpServer server; |
| 12 | 12 |
| 13 /** If set, serve up static files from this directory. */ | 13 /** If set, serve up static files from this directory. */ |
| 14 String staticFileDirectory; | 14 String staticFileDirectory; |
| 15 | 15 |
| 16 /* A common subset of all possible MIME types. */ | 16 /* A common subset of all possible MIME types. */ |
| 17 static const MIME_TYPES = const { | 17 static const MIME_TYPES = const { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 var argResults = optionsParser.parse(new Options().arguments); | 107 var argResults = optionsParser.parse(new Options().arguments); |
| 108 var server = new HttpTestServer( | 108 var server = new HttpTestServer( |
| 109 int.parse(argResults['port']), | 109 int.parse(argResults['port']), |
| 110 argResults['root']); | 110 argResults['root']); |
| 111 } catch (e) { | 111 } catch (e) { |
| 112 print(e); | 112 print(e); |
| 113 print('Usage: http_server_test_runner.dart <options>'); | 113 print('Usage: http_server_test_runner.dart <options>'); |
| 114 print(optionsParser.getUsage()); | 114 print(optionsParser.getUsage()); |
| 115 } | 115 } |
| 116 } | 116 } |
| OLD | NEW |