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;
|
2018-02-07 04:34:08 +00:00
|
|
|
export 'angel_http.dart';
|
2016-09-15 19:53:01 +00:00
|
|
|
export 'controller.dart';
|
2018-02-07 05:26:33 +00:00
|
|
|
export 'http_request_context.dart';
|
|
|
|
export 'http_response_context.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
|
2018-06-08 07:06:26 +00:00
|
|
|
.bind(address ?? '127.0.0.1', port ?? 0, shared: true);
|
2017-04-01 01:00:24 +00:00
|
|
|
|
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(
|
2018-06-08 07:06:26 +00:00
|
|
|
address ?? '127.0.0.1', port ?? 0, securityContext,
|
2017-04-01 01:00:24 +00:00
|
|
|
shared: true);
|
|
|
|
}
|