platform/lib/src/http/http.dart

34 lines
1.2 KiB
Dart
Raw Normal View History

/// Various libraries useful for creating highly-extensible servers.
2016-02-28 13:11:17 +00:00
library angel_framework.http;
2017-04-01 01:00:24 +00:00
import 'dart:async';
import 'dart:io';
import 'server.dart' show ServerGenerator;
2017-09-22 04:48:22 +00:00
export 'package:angel_http_exception/angel_http_exception.dart';
export 'package:angel_model/angel_model.dart';
2016-10-22 20:41:36 +00:00
export 'package:angel_route/angel_route.dart';
2017-03-04 23:09:57 +00:00
export 'package:body_parser/body_parser.dart' show FileUploadInfo;
export 'angel_base.dart';
2017-02-01 21:43:18 +00:00
export 'anonymous_service.dart';
export 'controller.dart';
export 'hooked_service.dart';
2017-02-23 00:37:15 +00:00
export 'map_service.dart';
export 'metadata.dart';
export 'request_context.dart';
export 'response_context.dart';
export 'routable.dart';
export 'server.dart';
export 'service.dart';
2017-02-23 00:37:15 +00:00
export 'typed_service.dart';
2016-06-27 00:20:42 +00:00
2017-04-01 01:00:24 +00:00
/// Boots a shared server instance. Use this if launching multiple isolates
2017-10-04 14:09:12 +00:00
Future<HttpServer> startShared(address, int port) => HttpServer
2017-04-01 01:00:24 +00:00
.bind(address ?? InternetAddress.LOOPBACK_IP_V4, port ?? 0, shared: true);
/// Boots a secure shared server instance. Use this if launching multiple isolates
ServerGenerator startSharedSecure(SecurityContext securityContext) {
2017-10-04 14:09:12 +00:00
return (address, int port) => HttpServer.bindSecure(
2017-04-01 01:00:24 +00:00
address ?? InternetAddress.LOOPBACK_IP_V4, port ?? 0, securityContext,
shared: true);
}