diff --git a/README.md b/README.md index 2bf9a154..8d591411 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # angel_framework -[![pub 1.0.0-dev.60](https://img.shields.io/badge/pub-1.0.0--dev.60-red.svg)](https://pub.dartlang.org/packages/angel_framework) +[![pub 1.0.0-dev.61](https://img.shields.io/badge/pub-1.0.0--dev.61-red.svg)](https://pub.dartlang.org/packages/angel_framework) [![build status](https://travis-ci.org/angel-dart/framework.svg)](https://travis-ci.org/angel-dart/framework) Core libraries for the Angel Framework. diff --git a/lib/src/http/request_context.dart b/lib/src/http/request_context.dart index 565473ed..f5251d0a 100644 --- a/lib/src/http/request_context.dart +++ b/lib/src/http/request_context.dart @@ -4,7 +4,7 @@ import 'dart:async'; import 'dart:io'; import 'package:angel_route/src/extensible.dart'; import 'package:body_parser/body_parser.dart'; -import 'angel_base.dart'; +import 'server.dart' show Angel; /// A convenience wrapper around an incoming HTTP request. class RequestContext extends Extensible { @@ -17,7 +17,7 @@ class RequestContext extends Extensible { final Map serviceParams = {}; /// The [Angel] instance that is responding to this request. - AngelBase app; + Angel app; /// Any cookies sent with this request. List get cookies => io.cookies; @@ -82,7 +82,7 @@ class RequestContext extends Extensible { } /// Magically transforms an [HttpRequest] into a [RequestContext]. - static Future from(HttpRequest request, AngelBase app) async { + static Future from(HttpRequest request, Angel app) async { RequestContext ctx = new RequestContext(); ctx.app = app; diff --git a/lib/src/http/response_context.dart b/lib/src/http/response_context.dart index 1af81498..25fe5b2e 100644 --- a/lib/src/http/response_context.dart +++ b/lib/src/http/response_context.dart @@ -7,7 +7,7 @@ import 'package:angel_route/angel_route.dart'; import 'package:json_god/json_god.dart' as god; import 'package:mime/mime.dart'; import '../extensible.dart'; -import 'angel_base.dart'; +import 'server.dart' show Angel; import 'controller.dart'; final RegExp _contentType = @@ -23,7 +23,7 @@ class ResponseContext extends Extensible { bool _isOpen = true; /// The [Angel] instance that is sending a response. - AngelBase app; + Angel app; /// Is `Transfer-Encoding` chunked? bool chunked; diff --git a/lib/src/http/server.dart b/lib/src/http/server.dart index e61995b0..a4df0bcd 100644 --- a/lib/src/http/server.dart +++ b/lib/src/http/server.dart @@ -121,7 +121,11 @@ class Angel extends AngelBase { Future startServer([InternetAddress address, int port]) async { var host = address ?? InternetAddress.LOOPBACK_IP_V4; this.httpServer = await _serverGenerator(host, port ?? 0); - await Future.wait(justBeforeStart.map(configure)); + + for (var configurer in justBeforeStart) { + await configure(configurer); + } + preprocessRoutes(); return httpServer..listen(handleRequest); } @@ -480,7 +484,7 @@ class Angel extends AngelBase { Platform.script.resolve(certificateChainPath).toFilePath(); var serverKey = Platform.script.resolve(serverKeyPath).toFilePath(); var serverContext = new SecurityContext(); - serverContext.useCertificateChain(certificateChain); + serverContext.useCertificateChain(certificateChain, password: password); serverContext.usePrivateKey(serverKey, password: password); return new Angel.fromSecurityContext(serverContext); diff --git a/pubspec.yaml b/pubspec.yaml index 3b11f006..fcfbd8c2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 1.0.0-dev.60 +version: 1.0.0-dev.61 description: Core libraries for the Angel framework. author: Tobe O homepage: https://github.com/angel-dart/angel_framework