This is a basic template to help you get up and running with Toto in a Vagrant dev environment.
Before you can use this project, make sure you have Virtual Box and Vagrant installed. Once you've installed both tools, follow these steps:
- Clone this repo.
- From the project directory run the command
vagrant up
. - Wait for Vagrant to configure the VM
Once you've completed these steps, the contents of the static
directory will be hosted by Nginx at http://42.42.42.42
.
By default, this is a blank page with a few script tags to get you set up with toto.js. The service in the service
directory will be listening at http://42.42.42.42/service
. You can shutdown the environment with vagrant halt
from anywhere in the
project directory structure. Run vagrant
without any arguments for a list of available commands.
There are a few special commands available to help you out:
vagrant toto <command>
- Passes<command>
to your Toto service so you can easily--restart
after you make changes (or run your service with other options). This command actually runsservice/services.sh
, which acts as a proxy to your Toto service and makes it easy to manage multiple services simultaneously.vagrant nginx <signal>
- Callsnginx -s <signal>
in the VM. In the special case where<signal>
isstart
, this will callnginx
.
Along with the usual Vagrant configuration and customization available to you, there are a few shortcuts to make basic configuration a bit easier.
- The
nginx-conf
directory is simlinked to the usual Ubuntu/etc/nginx/sites-enabled
directory for easy Nginx setup. setup-files/setup.sql
will be run after MySQL is installed in the dev environment to facilitate database creation and test data population.setup-files/python.sh
will be run after pip is installed so that you can install any extra packages or modules your service requires.- Finally,
setup-files/post-setup.sh
will run after all other steps are complete for any final cleanup.
Note: all scripts are run in the VM as root.
For more advanced setup, check out the documentation for Vagrant and Toto.