Running servers in foreground

November 07, 2013

A common need during development is running Zato servers in foreground instead of using the full CLI.

This can be easily achieved by issuing a command like below:

$ /path/to/zato-binary/bin/py -m zato.server.main /path/to/server

For instance, if you've installed Zato to /opt/zato and a server to /home/user/server1, the full command will be

$ /opt/zato/bin/py -m zato.server.main /home/user/server1

Note that it can be shortened to the following one if you've followed the recommended installation steps and Zato binaries are on PATH

$ py -m zato.server.main /home/user/server1

Server started in such a way can be stopped using Ctrl-C as in the screenshots below.

Screenshot Screenshot

Note that as an additional bonus, log levels will be in color when servers run in foreground.