This repository holds all simulations that will be embedded into OpenStax textbooks.
- First install node dependencies by running
npm install. - Install grunt-cli globally by running
npm install -g grunt-clito make things simpler.
- To build all the simulations and place their
distfolders into a single top-leveldistfolder for serving, rungrunt distfrom the repository root.
- To build and deploy all simulations to github-pages, run
grunt deploy.
The simulations can be hosted for development with any web host, but two options are documented here:
Both methods will create a server whose web root is this repository root; therefore, to access a specific simulation in dev mode, simply point your browser to
http://localhost:PORT/simulations/SIM-NAME/src
where PORT and SIM-NAME are replaced by appropriate values. Example:
http://localhost:8080/simulations/wave-interference/src
- Follow the Pre-Build Setup under Building and Deploying
- Run
grunt devfrom the repository root. - Open up http://localhost:8080 in your browser to view a list of simulations.
-
Install nginx
-
Set up a virtual host pointing to your
moving-man/srcdirectory. You can follow a tutorial like this one, but when you get to the part where you're defining a server config, do something like this (replacingpath-to-simulationsappropriately):server { listen 8080; server_name $hostname; root /path-to-simulations/simulations/; index index.html; try_files $uri $uri/ /index.html; } -
Run
sudo nginxto start the server. -
Open up http://localhost:8080 in your browser to view a list of simulations.
This software is subject to the provisions of the GNU Affero General Public License Version 3.0 (AGPL). See license.txt for details. Copyright (c) 2013 Rice University.