[英]zeit serve command is not allowing `index.html` string showing on url
我正在使用 Zeit服务
我的文件夹有一个非常基本的index.html
文件。
现在,如果我导航到该文件夹,然后输入serve
命令并按回车键, serve
为我启动一个网站。
我的问题来了,我可以导航到/
没有问题,但是当我想导航到
/index.html
serve
立即将我的 URL 路径重定向到/
。
如果我的 URL 包含字符串index.html
我如何告诉serve
不要重定向我的 URL?
我已经运行了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
这是 Zeit serve 的一个“功能”-> 在一个仍然悬而未决的问题中阅读更多关于这个“问题”的信息(还有很多其他问题,关于 url 的解析):
https://github.com/zeit/serve/issues/431
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.