katon
![](https://camo.githubusercontent.com/5a60a73146d60b2be1658460c3006930ec45fa364c2e5446ab9bc43bb3281df0/68747470733a2f2f7472617669732d63692e6f72672f74797069636f64652f6b61746f6e2e7376673f6272616e63683d6d6173746572)
Autostarts your development servers so that you can be more productive
With katon, there's no need anymore to open a Terminal and manually start developement servers each time you want to develop.
Instead, add your development servers once to katon and they'll be autostarted and always accessible on local .ka domains.
Click here to view a screenshot of katon + Express + Rails
katon supports any server: Node, Ruby, Python, Go, Java, PHP, ... that can be started with a command-line and runs on Mac OS (Yosemite included).
PS: Nominate katon (or another open-source project you like) on http://www.dotjs.eu/prize
Install
Make sure Node is installed first, then:
$ npm install -g katon
$ sudo katon install && katon start
Add servers
$ katon add 'nodemon'
$ katon add 'npm start'
$ katon add 'grunt server'
$ katon add 'rails server --port $PORT'
$ katon add 'python -m SimpleHTTPServer $PORT'
To add a server with a different name than its directory.
$ katon add 'grunt server' my-custom-name
Application is now available at http://my-custom-name.ka
Note: it's important to use '
and not "
to avoid $PORT
to be evaluated.
Port is dynamically set by katon using PORT
environment variable but can be passed as a parameter using $PORT
.
In case your server doesn't accept a port parameter, you can retrieve the PORT
environment variable in your code. For example, for a Node server you would write something like:
var port = process.env.PORT || 3000;
The same technique can be applied with other languages too.
Subdomains
When adding a server, you can access it by its URL http://app.ka
. But you can also use subdomains (e.g. http://foo.app.ka
, http://bar.app.ka
, ...).
If you want to map a server to a subdomain, let's say api.app.ka
, simply use katon add <cmd> api.app
.
xip.io
katon is also fully compatible with xip.io service.
Logs
Server logs are stored in <server_dir>/katon.log
, to view them run:
$ tail -f katon.log
Version managers
katon works with any version manager, simply set the desired version before adding your server and katon will remember it.
$ nvm use 0.11 && katon add 'npm start'
$ rbenv local 2.0.0-p481 && katon add 'rails server --port $PORT'
Depending on your version manager, you may need to add environment variables.
$ rvm use ruby-2.0.0-p576 && katon add 'bundle exec unicorn' --env GEM_PATH
# Will use GEM_PATH previously set by rvm
For Node users, to keep access to katon CLI accross Node versions, add an alias to your .profile and reopen the Terminal.
echo "alias katon=`which katon`" >> ~/.profile
Troubleshoot
Run katon status
or check ~/.katon/daemon.log
.
If you're stuck, feel free to create an issue.
Uninstall
$ npm rm -g katon
This will run the uninstall script wich does basically katon stop && sudo katon uninstall
. To remove katon completely, run also rm -rf ~/.katon
.
Credits
License
katon is released under the MIT License.