typicode /hotel
🏩 A simple process manager for developers. Start apps from your browser and access them using local domains
★ 9,986⑂ 440👁 112⑃ 161● 232▤ 1
More from this author
+0
Daily
9,986
stars
440
forks
112
watchers
161
prs
232
issues
1
releases
README
hotel
Start apps from your browser and use local domains/https automatically
!
_Tip: if you don't enable local domains, hotel can still be used as a catalog of local servers._
Hotel works great on any OS (macOS, Linux, Windows) and with __all servers :heart:__
Node (Express, Webpack)
PHP (Laravel, Symfony)
Ruby (Rails, Sinatra, Jekyll)
Python (Django)
Docker
Go
Apache, Nginx
...
_To all the amazing people who have answered the Hotel survey, thanks so much [opts]
hotel run [opts]
Examples
hotel add 'nodemon app.js' --out dev.log Set output file (default: none)
hotel add 'nodemon app.js' --name name Set custom name (default: current dir name)
hotel add 'nodemon app.js' --port 3000 Set a fixed port (default: random port)
hotel add 'nodemon app.js' --env PATH Store PATH environment variable in server config
hotel add http://192.168.1.10 --name app map local domain to URL
hotel run 'nodemon app.js' Run server and get a temporary local domain
Other commands
hotel ls List servers
hotel rm Remove server
hotel start Start hotel daemon
hotel stop Stop hotel daemon
To get help
sh
hotel --help
hotel --help
Port
For hotel to work, your servers need to listen on the PORT environment variable.
Here are some examples showing how you can do it from your code or the command-line:
js
var port = process.env.PORT || 3000
server.listen(port)
sh
hotel add 'cmd -p $PORT' OS X, Linux
hotel add "cmd -p %PORT%" Windows
Fallback URL
If you're offline or can't configure your browser to use .localhost domains, you can __always__ access your local servers by going to localhost:2000.
Configurations, logs and self-signed SSL certificate
You can find hotel related files in ~/.hotel :
sh
~/.hotel/conf.json
~/.hotel/daemon.log
~/.hotel/daemon.pid
~/.hotel/key.pem
~/.hotel/cert.pem
~/.hotel/servers/.json
By default, hotel uses the following configuration values:
js
{
"port": 2000,
"host": '127.0.0.1',
// Timeout when proxying requests to local domains
"timeout": 5000,
// Change this if you want to use another tld than .localhost
"tld": 'localhost',
// If you're behind a corporate proxy, replace this with your network proxy IP (example: "1.2.3.4:5000")
"proxy": false
}
To override a value, simply add it to ~/.hotel/conf.json and run hotel stop && hotel start
Third-party tools
Hotelier Hotelier (Mac & Windows Tray App)
Hotel Clerk OS X menubar
HotelX Another OS X menubar (only 1.6MB)
alfred-hotel Alfred 3 workflow
Hotel Manager Gnome Shell extension
FAQ
Setting a fixed port
sh
hotel add --port 3000 'server-cmd $PORT'
Adding X-Forwarded- headers to requests
sh
hotel add --xfwd 'server-cmd'
Setting HTTP_PROXY env
Use --http-proxy-env flag when adding your server or edit your server configuration in ~/.hotel/servers
sh
hotel add --http-proxy-env 'server-cmd'
Proxying requests to a remote https server
sh
hotel add --change-origin 'https://Top issues
#245How to run a script when visiting a hotel site23 comments · 2017-11-27#180Crashing - not sure of the cause13 comments · 2017-03-07#212Deamon does not start after fresh install on Windows 1010 comments · 2017-08-02#149Feature: Port forwarding9 comments · 2016-12-06#272.localhost domains isn't working in chrome browser8 comments · 2018-01-30#184Option for setting command for what happens when turning process off8 comments · 2017-03-23#172Works in browser but not in iTerm?8 comments · 2017-02-16#326Proxy stopped working on Mac7 comments · 2018-12-20
Latest release
v1.0.0 v1.0.0 2023-10-23- Fix 361