Initiating HTTP Server using different scripting languages
Python
python 2.x - python -m SimpleHTTPServer 8000
python 3.x - python -m http.server 8000
http-server (Node.js)
npm install -g http-server # install dependency
http-server -p 8000
node-static (Node.js)
npm install -g node-static # install dependency
static -p 8000
Ruby
ruby -rwebrick -e’WEBrick::HTTPServer.new(:Port => 3000, :DocumentRoot => Dir.pwd).start’
Ruby 1.9.2+
- ruby -run -ehttpd . -p3000
adsf (Ruby)
- gem install adsf # install dependency
- adsf -p 8000
Perl
----
cpan HTTP::Server::Brick # install dependency
- $ perl -MHTTP::Server::Brick -e ‘$s=HTTP::Server::Brick->new(port=>8000); $s->mount(“/”=>{path=>”.”}); $s->start’
Plack (Perl)
- cpan Plack # install dependency
- plackup -MPlack::App::Directory -e ‘Plack::App::Directory->new(root=>”.”);’ -p 8000
PHP (>= 5.4)
------------
php -S 127.0.0.1:8000
busybox httpd
-------------
busybox httpd -f -p 8000
webfs
-----
webfsd -F -p 8000
IIS Express
-----------
C:\> “C:\Program Files (x86)\IIS Express\iisexpress.exe” /path:C:\MyWeb /port:8000
Comments
Post a Comment