Command Line Usage

Once the gem is installed the `serve` command will be available from the command prompt. To launch Serve, just type the command and press enter:


This will launch a simple web server which you can access from any web browser at the following address:


Once the server is going it will output a running log of its activity. To stop the server at any time, type CTRL+C at the command prompt. By default the serve command serves up files from the current directory. To change this behavior, `cd` to the appropriate directory before starting serve or pass the directory as the final parameter to the command:

serve my-project

The `serve` command automatically binds to (localhost) and uses port 4000 by default. To serve files over a different IP (that is bound to your computer) or port specify those options on the command line:

serve 4000               # a custom port
serve        # a custom IP
serve   # a custom IP and port

For your convenience if the file "script/server" exists in the current directory the serve command will start that instead of launching a Ruby Web server. You can specify the environment that you want to start the server with as an option on the command line:

serve production         # start script/server in production mode