V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
iblessyou
V2EX  ›  问与答

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

  •  
  •   iblessyou · 316 天前 · 774 次点击
    这是一个创建于 316 天前的主题,其中的信息可能已经有所发展或是发生改变。

    之前一直是使用 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 的话,每次要找到配置目录里改,再命令行启动,比较麻烦

    7 条回复    2023-06-25 15:09:01 +08:00
    yandong1228
        1
    yandong1228  
       316 天前
    python -m httt.server
    blankmiss
        2
    blankmiss  
       316 天前
    python caddy 都行
    libook
        3
    libook  
       316 天前
    一般 linux 发行版都会自带 python ,根据是 python2 还是 python3 可以参考我写的这个脚本来启动一个简单的 http 服务器
    https://github.com/libook/IdleBox/blob/master/scripts/public/http-server
    iblessyou
        4
    iblessyou  
    OP
       316 天前
    @yandong1228
    @blankmiss
    @libook
    呃,感谢回复,不过好像都没理解我意思。之前用 mobaxterm ,也就是在 windows 上使用的,
    本机现在没 python 环境,专门弄个倒不如继续用 nginx
    主要就是想找个小工具,能快速修改路径和启停。
    Al0rid4l
        5
    Al0rid4l  
       315 天前
    https://github.com/sigoden/dufs 我都用的这个
    https://github.com/svenstaro/miniserve 以前用的这个, 不过后来感觉上面的好用点
    iblessyou
        6
    iblessyou  
    OP
       312 天前
    [![https://www.hualigs.cn/image/6497a8402e0ab.jpg]( https://www.hualigs.cn/image/6497a8402e0ab.jpg)]( https://www.hualigs.cn/image/6497a8402e0ab.jpg)
    @Al0rid4l 好像你理解错了,我其实是要的类似这个这样,用来发布静态前端页面,而不是文件服务器的
    iblessyou
        7
    iblessyou  
    OP
       312 天前
    @Al0rid4l 简单试了下,发现他也可以发布 html ,本身不大,就每个小项目里都丢一个,写个 cmd 文件放那,暂时能解决我问题了
    感谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2295 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 08:42 · PVG 16:42 · LAX 01:42 · JFK 04:42
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.