From 0de6c5234f6056a8617fbc89f9188d7b69877a33 Mon Sep 17 00:00:00 2001 From: regiostech Date: Thu, 28 Apr 2016 20:12:57 -0400 Subject: [PATCH] Index routes work. :) --- lib/src/http/server.dart | 5 +++-- pubspec.yaml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/src/http/server.dart b/lib/src/http/server.dart index a8cc858d..f9c2d949 100644 --- a/lib/src/http/server.dart +++ b/lib/src/http/server.dart @@ -41,8 +41,9 @@ class Angel extends Routable { this.httpServer = server; server.listen((HttpRequest request) async { - String req_url = - request.uri.toString().replaceAll(new RegExp(r'\/+$'), ''); + String req_url = request.uri.toString().replaceAll(new RegExp(r'\/+$'), ''); + if (req_url.isEmpty) + req_url = '/'; RequestContext req = await RequestContext.from(request, {}, this, null); ResponseContext res = await ResponseContext.from(request.response, this); diff --git a/pubspec.yaml b/pubspec.yaml index 4cce9475..d35f5c76 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: angel_framework -version: 0.0.0-dev.6 +version: 0.0.0-dev.7 description: Core libraries for the Angel framework. author: Tobe O homepage: https://github.com/angel-dart/angel_framework