在包含index.html
的目录中,我输入python -m http.server 8085
并获取:
Serving HTTP on 0.0.0.0 port 8085 (http://0.0.0.0:8085/) ...
127.0.0.1 - - [29/May/2018 08:56:40] code 404, message File not found
127.0.0.1 - - [29/May/2018 08:56:40] "GET /dist/css/bootstrap.min.css HTTP/1.1" 404 -
127.0.0.1 - - [29/May/2018 08:56:40] code 404, message File not found
127.0.0.1 - - [29/May/2018 08:56:40] "GET /assets/js/vendor/popper.min.js HTTP/1.1" 404 -
但是index.html
里面的导入行是
<link href="../../../../dist/css/bootstrap.min.css" rel="stylesheet">
<script src="../../../../assets/js/vendor/popper.min.js"></script>
这些路径相对于该目录是正确的,如果我将linux ls
应用于那里的引号之间的路径,它会找到它们。
在浏览器的控制台内,它同样抱怨:
Loading failed for the <script> with source “http://0.0.0.0:8085/assets/js/vendor/popper.min.js”.
0.0.0.0:8085:131
是的,131是该导入语句的行,但为什么忽略那里的路径?