This commit is contained in:
thosakwe 2016-12-10 09:50:05 -05:00
parent 59a4a22774
commit a72c036dd1
4 changed files with 8 additions and 6 deletions

View file

@ -1,6 +1,6 @@
# angel_client # angel_client
[![pub 1.0.0-dev+17](https://img.shields.io/badge/pub-1.0.0--dev+17-red.svg)](https://pub.dartlang.org/packages/angel_client) [![pub 1.0.0-dev+18](https://img.shields.io/badge/pub-1.0.0--dev+18-red.svg)](https://pub.dartlang.org/packages/angel_client)
![build status](https://travis-ci.org/angel-dart/client.svg) ![build status](https://travis-ci.org/angel-dart/client.svg)
Client library for the Angel framework. Client library for the Angel framework.

View file

@ -21,6 +21,8 @@ abstract class Angel {
String authEndpoint: '/auth', String authEndpoint: '/auth',
String reviveEndpoint: '/auth/token'}); String reviveEndpoint: '/auth/token'});
Future close();
/// Applies an [AngelConfigurer] to this instance. /// Applies an [AngelConfigurer] to this instance.
Future configure(AngelConfigurer configurer) async { Future configure(AngelConfigurer configurer) async {
await configurer(this); await configurer(this);

View file

@ -124,6 +124,10 @@ abstract class BaseAngelClient extends Angel {
} }
} }
Future close() async {
client.close();
}
@override @override
Service service<T>(String path, {Type type}) { Service service<T>(String path, {Type type}) {
String uri = path.replaceAll(straySlashes, ""); String uri = path.replaceAll(straySlashes, "");
@ -173,10 +177,6 @@ class BaseAngelService extends Service {
return '$head/$tail'; return '$head/$tail';
} }
Future close() async {
client.close();
}
Future<http.StreamedResponse> send(http.BaseRequest request) { Future<http.StreamedResponse> send(http.BaseRequest request) {
if (app.authToken != null && app.authToken.isNotEmpty) { if (app.authToken != null && app.authToken.isNotEmpty) {
request.headers['Authorization'] = 'Bearer ${app.authToken}'; request.headers['Authorization'] = 'Bearer ${app.authToken}';

View file

@ -1,5 +1,5 @@
name: angel_client name: angel_client
version: 1.0.0-dev+17 version: 1.0.0-dev+18
description: Client library for the Angel framework. description: Client library for the Angel framework.
author: Tobe O <thosakwe@gmail.com> author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/angel_client homepage: https://github.com/angel-dart/angel_client