📜 ⬆️ ⬇️

All that wanted

Hotel - a shelter for localhost.


Run and manage all your web projects from one address.


More, different ports of crutches .


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.



1. Install and run the hotel:


npm install -g hotel && hotel start 

2. Check in projects at the hotel:


 # 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' 

3. Now they live in the hotel http: // localhost: 2000 /


How to open a project?



How does hotel.dev work?


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