LoginSignup
20
21

More than 5 years have passed since last update.

Macで簡易httpサーバ立ち上げコマンドスニペット

Posted at

pythonのSimpleHTTPServer

Macにはpythonはデフォルトインストールされてるので、すぐ立ち上げられる

server.command
#!/bin/bash
cd `dirname $0`
python -m SimpleHTTPServer 8080

PHP5.4~のビルトインウェブサーバ

PHP5.4以降が入ってなかったらインストールしてから利用する。
下記のスニペットは、パスが5.4に向いてない場合の指定。

server.command
#!/bin/bash
cd `dirname $0`
/usr/local/php5/bin/php -S 127.0.0.1:8088

ほかに簡易httpサーバとしてSublimeServer使ったりnodeで立ち上げたり。

おしまい

20
21
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
20
21