Node v6.10.0
macOS
brew install mongodb
macOS
brew install redis
npm install nodemon -g
npm install
Install Dnsmasq
# Install it
brew install dnsmasq
# Create the etc dir if needed
mkdir -p /usr/local/etc
# Create a simple configuration
# This forces the .dev domain to respond with 127.0.0.1
# You can find more information in the default config file:
# /usr/local/opt/dnsmasq/dnsmasq.conf.example
echo "address=/localhost/127.0.0.1" > /usr/local/etc/dnsmasq.conf
# Install the daemon startup file
sudo cp -fv /usr/local/opt/dnsmasq/*.plist \
/Library/LaunchDaemons
# Start the daemon
sudo launchctl load \
/Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
Configure macOS
# man 5 resolver
sudo mkdir -p /etc/resolver
sudo sh -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'
Dnsmasq to DNSAgent rules convert tool
options.cfg:
{
"HideOnStart": false,
"ListenOn": "127.0.0.1:3000, [::1]", //port 3000
"DefaultNameServer": "119.29.29.29",
"UseHttpQuery": false,
"QueryTimeout": 4000,
"CompressionMutation": false,
"CacheResponse": true,
"CacheAge": 86400,
"NetworkWhitelist": null
}
rules.cfg:
[
{
"Pattern": "^(.*\\.)?localhost$",
"Address": "127.0.0.1"
}
]
1 tab = 2 whitespace !!!
npm install eslint -g
sudo mongod
redis-server
npm start