Команда zeit serve не разрешает показ строки `index.html` в URL - PullRequest
0 голосов
/ 23 марта 2020

Я использую Zeit serve

Моя папка имеет очень простой c index.html файл.

Теперь, если Я перехожу к этой папке, набираю команду serve и нажимаю клавишу ввода, serve запускает веб-сайт для меня.

Здесь возникает мой вопрос, я могу перейти к / без проблем, но когда я хочу перейти к

/index.html

serve немедленно перенаправить мой путь к URL на /.

Как я могу сказать serve не перенаправлять мой URL если она содержит строку index.html?

Я запустил serve -h, но я все еще не знаю, как ее изменить.


  serve - Static file serving and directory listing

  USAGE

      $ serve --help
      $ serve --version
      $ serve folder_name
      $ serve [-l listen_uri [-l ...]] [directory]

      By default, serve will listen on 0.0.0.0:5000 and serve the
      current working directory on that address.

      Specifying a single --listen argument will overwrite the default, not supplement it.

  OPTIONS

      --help                              Shows this help message

      -v, --version                       Displays the current version of serve

      -l, --listen listen_uri             Specify a URI endpoint on which to listen (see below) -
                                          more than one may be specified to listen in multiple places

      -d, --debug                         Show debugging information

      -s, --single                        Rewrite all not-found requests to `index.html`

      -c, --config                        Specify custom path to `serve.json`

      -n, --no-clipboard                  Do not copy the local address to the clipboard

      -u, --no-compression                Do not compress files

      --no-etag                           Send `Last-Modified` header instead of `ETag`

      -S, --symlinks                      Resolve symlinks instead of showing 404 errors

      --ssl-cert                          Optional path to an SSL/TLS certificate to serve with HTTPS

      --ssl-key                           Optional path to the SSL/TLS certificate's private key

  ENDPOINTS

      Listen endpoints (specified by the --listen or -l options above) instruct serve
      to listen on one or more interfaces/ports, UNIX domain sockets, or Windows named pipes.

      For TCP ports on hostname "localhost":

          $ serve -l 1234

      For TCP (traditional host/port) endpoints:

          $ serve -l tcp://hostname:1234

      For UNIX domain socket endpoints:

          $ serve -l unix:/path/to/socket.sock

      For Windows named pipe endpoints:

          $ serve -l pipe:\\.\pipe\PipeName

1 Ответ

0 голосов
/ 23 марта 2020

Это «особенность» Zeit serve -> подробнее об этой «проблеме» читайте в еще открытом вопросе (есть множество других, касающихся разрешения URL):
https://github.com/zeit/serve/issues/431

...