〖network〗 a line command to create a http-server

Source: Internet
Author: User

One line of command starts Http-server summary:
1. python2.x
Python2-m Simplehttpserver 8000

2. python3.x
Python-m Http.server 8000

3. TWISTD (Python)
Twistd-n Web-p 8000--path.
Or 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 (:P ort = 8000,:D ocumentroot = 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:p ublic_folder, "."; Set:p ort, 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::D irectory-e ' Plack::app::D irectory->new (root=> "."); '-P 8000

Ten. Mojolicious (Perl)
CPAN Mojolicious::lite
Perl-mmojolicious::lite-mcwd-e ' app->static->paths->[0]=getcwd; App->start ' Daemon-l http://*:8000

Http-server (node. js)
NPM install-g Http-server
Http-server-p 8000

Node-static (node. js)
NPM install-g node-static
Static-p 8000

PHP (>=5.4)
Php-s 127.0.0.1:8000

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 "}]}]).

BusyBox httpd
BusyBox Httpd-f-P 8000
Syntax: BusyBox httpd-p $PORT-H $HOME [-C httpd.conf]

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

Drush 5+
Drush RS 8080

Spark (GO)
Go get Github.com/rif/spark
Spark-port 8000.

There's more.
Reference Links:
[1] https://gist.github.com/willurd/5720255

〖network〗 a line command to create a http-server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.