一行命令启动http-server总结:
1. python2.x
python2 -m SimpleHTTPServer 8000

2. python3.x
python -m http.server 8000

3. twistd(python)
twistd -n web -p 8000 --path .
或者 python -c 'from twisted.web.server import Site; from twisted.web.static import File; from twisted.internet import reactor; reactor.listenTCP(8000, Site(File("."))); reactor.run()'

4. ruby
ruby -rwebrick -e'WEBrick::HTTPServer.new(:Port => 8000, :DocumentRoot => Dir.pwd).start'

5. ruby1.9.2+
ruby -run -ehttpd . -p8000

6. adsf(ruby)
gem install adsf
adsf -p 8000

7. sinatra(ruby)
gem install sinatra
ruby -rsinatra -e'set :public_folder, "."; set :port, 8000'

8. perl
cpan HTTP::Server::Brick
perl -MHTTP::Server::Brick -e '$s=HTTP::Server::Brick->new(port=>8000); $s->mount("/"=>{path=>"."}); $s->start'

9. plack(perl)
cpan Plack
plackup -MPlack::App::Directory -e 'Plack::App::Directory->new(root=>".");' -p 8000

10. mojolicious(perl)
cpan Mojolicious::Lite
perl -MMojolicious::Lite -MCwd -e 'app->static->paths->[0]=getcwd; app->start' daemon -l http://*:8000

11. http-server(Node.js)
npm install -g http-server
http-server -p 8000

12. node-static(Node.js)
npm install -g node-static
static -p 8000

13. php(>=5.4)
php -S 127.0.0.1:8000

14. erlang
erl -s inets -eval 'inets:start(httpd,[{server_name,"NAME"},{document_root, "."},{server_root, "."},{port, 8000},{mime_types,[{"html","text/html"},{"htm","text/html"},{"js","text/javascript"},{"css","text/css"},{"gif","image/gif"},{"jpg","image/jpeg"},{"jpeg","image/jpeg"},{"png","image/png"}]}]).'

15. busybox httpd
busybox httpd -f -p 8000
语法:busybox httpd -p $PORT -h $HOME [ -c httpd.conf ]

16. iis express
C:\> "C:\Program Files (x86)\IIS Express\iisexpress.exe" /path:C:\MyWeb /port:8000

17. drush 5+
drush rs 8080

18. spark(go)
go get github.com/rif/spark
spark -port 8000 .

还有更多..
参考链接:
[1] https://gist.github.com/willurd/5720255

一行命令创建 http-server的更多相关文章

  1. 〖Network〗一行命令创建 http-server

    一行命令启动http-server总结:1. python2.x python2 -m SimpleHTTPServer 8000 2. python3.x python -m http.server ...

  2. 一行命令搞定VS2012无法安装cocos2d-x-2.1.4及创建跨平台项目(二)

    转自:http://blog.csdn.net/yangjingui/article/details/9418843 由于上次发了一个比较二的方法来解决VS2012无法安装cocos2d-x-2.1. ...

  3. python技巧一行命令搞定局域网共享

    python超强玩法--一行命令搞定局域网共享 ​ 今天刷到python的一个新玩法,利用python自带的http服务,快速创建局域网共享服务,命令如下: python -m thhp.server ...

  4. [SDK2.2]Windows Azure Virtual Network (3) 创建AD Server并添加至Virtual Network

    <Windows Azure Platform 系列文章目录> 在之前的文章中,笔者已经向大家介绍了如何创建一个简单的Azure Virtual Network. 本章我将创建一台域服务器 ...

  5. Maven学习(二)使用命令创建maven项目

    创建maven项目 手动 严格参照约定目录结构,我们开始手动新增文件夹 命令方式 project项目 我们也可以使用maven自动生成目录: mvn archetype:generate -Dgrou ...

  6. PIVOT 和 UNPIVOT 命令的SQL Server版本

    I:使用 PIVOT 和 UNPIVOT 命令的SQL Server版本要求 1.数据库的最低版本要求为 SQL Server 2005 或 更高 2.必须将数据库的兼容级别设置为 90 或 更高 3 ...

  7. 使用 NetBackup 命令创建 Hyper-V 策略(命令创建其他策略也是如此)

    Veritas NetBackup™ for Hyper-V 管理指南 Product(s): NetBackup (8.1) 使用 NetBackup 命令创建 Hyper-V 策略 本主题介绍如何 ...

  8. 一行命令搞定node.js 版本升级

    from:http://www.16boke.com/article/detail/26 今天,又发现一个超级简单的升级node.js的方法.一行命令搞定,省去了重新编译安装的过程. node有一个模 ...

  9. 创建link server链接服务器碰到的问题及解决办法

    问题描述 今天在做数据库迁移,然后新建link server(链接服务器)的时候,碰到以下问题. 我的sql 脚本是这样的. 然后,执行的时候就收到以下错误信息. Msg 468, Level 16, ...

随机推荐

  1. form表单的两种提交方式,submit和button的用法

    1.当输入用户名和密码为空的时候,需要判断.这时候就用到了校验用户名和密码,这个需要在jsp的前端页面写:有两种方法,一种是用submit提交.一种是用button提交.方法一: 在jsp的前端页面的 ...

  2. Spring实战——Profile

    看到Profile这个关键字,或许你从来没有正眼瞧过他,又或者脑海中有些模糊的印象,比如除了这里Springmvc中的Profile,maven中也有Profile的标签. 从字面意思来看,Profi ...

  3. Python 日志模块实例

    python 打印对象的所有属性值: def prn_obj(obj):     print '\n'.join(['%s:%s' % item for item in obj.__dict__.it ...

  4. jQuery的拾色器

    代码如下 1.js <link href="css/farbtastic.css" rel="stylesheet" /> <script t ...

  5. java-4-类和对象

    一.以下代码为何无法通过编译?哪儿出错了? 错误:只定义了一个有参数的构造函数.而在主函数中定义的Foo类对象调用的是无参数的构造函数. 更改后: 二.多当个类之间有继承关系时,创建子类对象会导致父类 ...

  6. Java String类和Object类

    String类: 方法: 1.charAt(int index):取index下标的char类型值 2.endsWith(String prefix) /startsWith(String prefi ...

  7. 简学Python第三章__函数式编程、递归、内置函数

    #cnblogs_post_body h2 { background: linear-gradient(to bottom, #18c0ff 0%,#0c7eff 100%); color: #fff ...

  8. POJ 2914 Minimum Cut Stoer Wagner 算法 无向图最小割

    POJ 2914 题意:给定一个无向图 小于500节点,和边的权值,求最小的代价将图拆为两个联通分量. Stoer Wagner算法: (1)用类似prim算法的方法求"最大生成树" ...

  9. jQuery ajax() 参数,回调函数,数据类型,发送数据到服务器,高级选项

    $.ajax({ options:/*类型:Object;  可选.AJAX 请求设置.所有选项都是可选的.*/ async:/*类型:Boolean; 默认值: true.默认设置下,所有请求均为异 ...

  10. Java第三天

    0.注释: 目的:方便其他人阅读理解我们的代码 三种: // 单行注释,进行解释 /**/ 多行注释 /***/ 多行注释 (/***/注释通常用于方法,函数注释,在调用写好的方法或是函数时可以通过点 ...