docs: function serve(root, route, opts) {
    opts = opts || {};
    route = route || '/';
    assert(root, 'root directory is required to serve files');
  
    // options
    debug('static "%s" "%s" %j', route, root, opts);
    opts.root = resolve(root);
    opts.index = opts.index || 'index.html';
  
    routes[route] = opts;
    return function *serve(next) {
      yield* next;
      debug('path: "%s"', this.path);
      var route = this.path.split('/')[1] || '/';
      if (this.method != 'HEAD' && this.method != 'GET') return;
      // response is already handled
      if (this.body != null || this.status != 404) return;
  
      yield send(this, this.path.slice(1 + route.length) || '/', routes[route]);
    };
  }