Permalink
Browse files

fix: sitegen --serve did not check if .packages-file is available

  • Loading branch information...
MikeMitterer committed Dec 15, 2016
1 parent 670fbeb commit a36b0e5ee2190cc1a7fff99a1b3cb0ad91c1ca67
Showing with 4 additions and 3 deletions.
  1. +4 −1 lib/src/Application.dart
  2. +0 −2 samples/simple/web/main.dart
View
@@ -133,6 +133,9 @@ class Application {
final Packages packages = new Packages();
// if hasPackages is false then we are not in a Dart-Project
final bool hasPackages = packages.hasPackages;
Future<HttpServer> connect;
if(config.usesecureconnection) {
final SecurityContext context = new SecurityContext();
@@ -151,7 +154,7 @@ class Application {
connect.then( (final HttpServer server) {
_logger.info('Server running $ip on port: $port, $MY_HTTP_ROOT_PATH');
server.listen( (final HttpRequest request) {
if(request.uri.path.startsWith("/packages")) {
if(request.uri.path.startsWith("/packages") && hasPackages) {
final List<String> parts = request.uri.path.split(new RegExp(r"(?:/|\\)"));
final String path = parts.sublist(3).join("/");
final String packageName = parts[2];
@@ -1,5 +1,3 @@
import 'dart:html' as html;
import 'package:logging/logging.dart';
import 'package:console_log_handler/console_log_handler.dart';

0 comments on commit a36b0e5

Please sign in to comment.