LoginSignup
0
0

More than 5 years have passed since last update.

コマンドひとつでWebサーバ構築する

Posted at

Python2

python -m SimpleHTTPServer 8000

Python3

python -m http.server 8000

Ruby

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

or

ruby -run -ehttpd . -p 8000

or

gem install adsf
adsf -p 8000

PHP

php -S localhost:8000

Nodejs

npm install -g http-server 
http-server -p 8000 .

or

npm install -g node-static
static -p 8000 .

busybox on Docker

docker run -it -p 8000:8000 busybox httpd -f -p 8000
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0