2016-09-15 19:53:01 +00:00
|
|
|
/// 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';
|
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;
|
2016-09-15 19:53:01 +00:00
|
|
|
export 'angel_base.dart';
|
2017-02-01 21:43:18 +00:00
|
|
|
export 'anonymous_service.dart';
|
2016-09-15 19:53:01 +00:00
|
|
|
export 'controller.dart';
|
|
|
|
export 'hooked_service.dart';
|
2017-02-23 00:37:15 +00:00
|
|
|
export 'map_service.dart';
|
2016-09-15 19:53:01 +00:00
|
|
|
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);
|
|
|
|
|
2018-02-07 04:17:40 +00:00
|
|
|
Future<HttpServer> Function(dynamic, int) 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);
|
|
|
|
}
|