Skip to content

Latest commit

 

History

History
68 lines (48 loc) · 1.31 KB

README.md

File metadata and controls

68 lines (48 loc) · 1.31 KB

fake-dev

fake development environment with nginx

requirements

install from Homebrew:

"homebrew/nginx" formulae renamed to "denji/homebrew"

$ brew tap denji/nginx
$ brew install nginx-full --with-subs-filter-module

If you get an error "Error: Formulae found in multiple taps:"

$ brew untap homebrew/nginx
$ brew tap denji/nginx
$ brew install nginx-full  --with-subs-filter-module

download config file:

$ curl -L https://raw.githubusercontent.com/tsukurite/fake-dev/master/fake-dev.conf -o ~/.fake-dev.conf

how to use

execute in webroot directory's hierarchy. execute below:

$ cd /path/to/app
$ nginx -p . -c ~/.fake-dev.conf

press Ctrl-c to exit.

tips

easily execute with fake-dev alias:

$ echo 'alias fake-dev="nginx -p . -c ~/.fake-dev.conf"' >> ~/.bashrc
$ cd /path/to/app
$ fake-dev

Start server with a specific port:

cat << EOS >> ~/.bashrc
function fake-dev-port () {
  sed -e "s/127.0.0.1:8080/127.0.0.1:\$1/g" ~/.fake-dev.conf > ~/.fake-dev.temp.conf
  nginx -p . -c ~/.fake-dev.temp.conf
}
EOS

License

The MIT license. Please see top of fake-dev.conf.