Hotel - a shelter for localhost.
Run and manage all your web projects from one address.
You can keep a zoo ports for each project: 9000, 8000, 8080, 3000, 3001 ...
Or configure a web server, edit the / etc / hosts file or DNS for each project.
And remember how to run a developer web server for each project:
Making life easier will help the hotel.
npm install -g hotel && hotel start
# foo project cd ~/foo hotel add 'gulp' -n foo -o foo-hotel.log # bar project cd ~/bar hotel add 'gulp serve' -n bar -o bar-hotel.log # baz project cd ~/baz hotel add 'gulp watch' -n baz -o baz-hotel.log # etc... hotel add 'ionic serve' hotel add 'browser-sync start --server --no-open --directory --files' hotel add 'http-server -p $PORT' hotel add 'python -m http.server $PORT' hotel add 'php -S localhost:$PORT'
Hotel allows you to open% any% .dev address in your browser, carefully raising and proxy your web server.
It is enough to specify the proxy in the browser
Using the small proxy auto-config script for the browser http: // localhost: 2000 / proxy.pac
function FindProxyForURL (url, host) { if (dnsDomainIs(host, '.dev')) { return 'PROXY 127.0.0.1:2000'; } return 'DIRECT'; }
If you feed this script to a brouser, then everything that ends in .dev will go through 127.0.0.1:2000 to your web.
Now the hotel will be available at hotel.dev.
And your projects at foo.dev, bar.dev, baz.dev.
Project GitHub: https://github.com/typicode/hotel
I ask about ochepyatki chap in PM.
Source: https://habr.com/ru/post/282511/
All Articles