a32d37ef84
This will contain the code for running the DTD server. When this is fully funcitonal VSCode will be responsible for running the, and letting our other tools(i.e. DevTools) know which address it is running at. Change-Id: Ia4cc9553f000a5e765f604541f4846b107d4d00c Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/338501 Commit-Queue: Dan Chevalier <danchevalier@google.com> Reviewed-by: Devon Carew <devoncarew@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com>
45 lines
1.2 KiB
Dart
45 lines
1.2 KiB
Dart
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
// TODO(danchevalier) make these tests relevant.
|
|
// import 'dart:io';
|
|
|
|
// import 'package:http/http.dart';
|
|
// import 'package:test/test.dart';
|
|
|
|
void main() {
|
|
// final port = '8080';
|
|
// final host = 'http://0.0.0.0:$port';
|
|
// late Process p;
|
|
|
|
// setUp(() async {
|
|
// p = await Process.start(
|
|
// 'dart',
|
|
// ['run', 'bin/dtd_server.dart'],
|
|
// environment: {'PORT': port},
|
|
// );
|
|
// // Wait for server to start and print to stdout.
|
|
// await p.stdout.first;
|
|
// });
|
|
|
|
// tearDown(() => p.kill());
|
|
|
|
// test('Root', () async {
|
|
// final response = await get(Uri.parse('$host/'));
|
|
// expect(response.statusCode, 200);
|
|
// expect(response.body, 'Hello, World!\n');
|
|
// });
|
|
|
|
// test('Echo', () async {
|
|
// final response = await get(Uri.parse('$host/echo/hello'));
|
|
// expect(response.statusCode, 200);
|
|
// expect(response.body, 'hello\n');
|
|
// });
|
|
|
|
// test('404', () async {
|
|
// final response = await get(Uri.parse('$host/foobar'));
|
|
// expect(response.statusCode, 404);
|
|
// });
|
|
}
|