有没有简单的 http 服务工具推荐一下啊

331 天前
 iblessyou

之前一直是使用 mobaxterm 的网络服务器工具,启动一个 http 服务器,
只需要选一下目录和端口就行了。
测试前端或者有时传文件很方便。

但是最近在测试前端时,发现使用 import ,总是提示

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "application/binary". Strict MIME type checking is enforced for module scripts per HTML spec.

想了解下有没有什么小工具可以替代他, nginx 的话,每次要找到配置目录里改,再命令行启动,比较麻烦

796 次点击
所在节点    问与答
7 条回复
yandong1228
331 天前
python -m httt.server
blankmiss
331 天前
python caddy 都行
libook
331 天前
一般 linux 发行版都会自带 python ,根据是 python2 还是 python3 可以参考我写的这个脚本来启动一个简单的 http 服务器
https://github.com/libook/IdleBox/blob/master/scripts/public/http-server
iblessyou
331 天前
@yandong1228
@blankmiss
@libook
呃,感谢回复,不过好像都没理解我意思。之前用 mobaxterm ,也就是在 windows 上使用的,
本机现在没 python 环境,专门弄个倒不如继续用 nginx
主要就是想找个小工具,能快速修改路径和启停。
Al0rid4l
330 天前
https://github.com/sigoden/dufs 我都用的这个
https://github.com/svenstaro/miniserve 以前用的这个, 不过后来感觉上面的好用点
iblessyou
327 天前
[![https://www.hualigs.cn/image/6497a8402e0ab.jpg]( https://www.hualigs.cn/image/6497a8402e0ab.jpg)]( https://www.hualigs.cn/image/6497a8402e0ab.jpg)
@Al0rid4l 好像你理解错了,我其实是要的类似这个这样,用来发布静态前端页面,而不是文件服务器的
iblessyou
327 天前
@Al0rid4l 简单试了下,发现他也可以发布 html ,本身不大,就每个小项目里都丢一个,写个 cmd 文件放那,暂时能解决我问题了
感谢

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/950625

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX