<commit_before>// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io';

import 'package:args/args.dart';
import 'package:shelf_static/shelf_static.dart';
import 'package:shelf/shelf_io.dart' as io;
import 'package:shelf/shelf.dart';
import 'package:shelf_route/shelf_route.dart' as shelf_route;

void printUsage(parser) {
  print('Usage: sky_server [-v] PORT');
  print(parser.usage);
}

void addRoute(var router, String route, String path) {
  router.add(
    route,
    ['GET'],
    createStaticHandler(
      path,
      serveFilesOutsidePath: true,
      listDirectories: true
    ), exactMatch: false
  );
}

main(List<String> argv) async {
  ArgParser parser = new ArgParser();
  parser.addFlag('help', abbr: 'h', negatable: false,
                 help: 'Display this help message.');
  parser.addFlag('verbose', abbr: 'v', negatable: false,
                 help: 'Log requests to stdout.');<commit_msg>Add support for HEAD requests<commit_after>// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io';

import 'package:args/args.dart';
import 'package:shelf_static/shelf_static.dart';
import 'package:shelf/shelf_io.dart' as io;
import 'package:shelf/shelf.dart';
import 'package:shelf_route/shelf_route.dart' as shelf_route;

void printUsage(parser) {
  print('Usage: sky_server [-v] PORT');
  print(parser.usage);
}

void addRoute(var router, String route, String path) {
  router.add(
    route,
    ['GET', 'HEAD'],
    createStaticHandler(
      path,
      serveFilesOutsidePath: true,
      listDirectories: true
    ), exactMatch: false
  );
}

main(List<String> argv) async {
  ArgParser parser = new ArgParser();
  parser.addFlag('help', abbr: 'h', negatable: false,
                 help: 'Display this help message.');
  parser.addFlag('verbose', abbr: 'v', negatable: false,
                 help: 'Log requests to stdout.');
{'fraction_non_alphanumeric': 0.12607040913415796, 'fraction_numerical': 0.003805899143672693, 'mean_word_length': 3.7364864864864864, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4183445', 'n_tokens_mistral': 691, 'n_tokens_neox': 665, 'n_words': 196}