使用ngrok托管HTML文件 [英] Host HTML file with ngrok

查看:98
本文介绍了使用ngrok托管HTML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用NGROK托管HTML文件而不是Web应用程序?我真的对NGROK一无所知,我只是用它为Twilio应用程序托管服务器,并且想用它为我的另一个项目托管HTML文件.另外,有人知道如何在Mac上创建HTML文件吗?提前致谢.或者,如果我不能使用NGROK,那么任何人都知道简单又免费的地方是,我可以使用它在计算机上托管HTML文件.我需要能够实时更改文件,所以Google网站和类似的东西就不成问题了.

Is it possible to host, instead of a web app, a HTML file with NGROK? I really don't know anything about NGROK, I just used it to host a server for a Twilio app, and am wanting to use it to host a HTML file for another one of my projects. Also, anybody know how to create a HTML file on a Mac? Thanks in advance. Or, If I can't use NGROK, anybody know something as easy and free is it is that I could use for hosting a HTML file on my computer. I need to be able to change the file in real time, so google sites and stuff like that are out of the question.

推荐答案

否. ngrok 仅通过隧道传输流量,因此它实际上不能为您提供 HTML文件.

No. ngrok only tunnels traffic, so it can't actually serve the HTML file for you.

但是,您可以非常轻松地提供文件目录.启动服务器最快的方法之一是使用python.从命令行cd到包含HTML文件的目录,然后运行:

You can, however, serve a directory of files very easily. One of the quickest ways to start a server is with python. From the command line, cd to the directory containing your HTML files and run:

$ python -m SimpleHTTPServer

或者对于python3(默认情况下未在OS X上安装):

Or for python3 (not installed by default on OS X):

$ python -m http.server

然后,在另一个终端中,运行ngrok.

Then, in another terminal, run ngrok.

这篇关于使用ngrok托管HTML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆