Build and Run

  • The revel command line tool is required to use the Revel framework
  • The code/app is in a seperate repository github.com/revel/cmd
  • It is NOT included with the main framework
  • To install, run the command below
	$ go get -u github.com/revel/cmd/revel
Gotcha: The command is in the subdirectory '/revel' ie revel/cmd/revel and not revel/cmd

Now run it:

$ bin/revel
~
~ revel! http://revel.github.io
~
usage: revel command [arguments]

The commands are:

	new         create a skeleton Revel application
	run         run a Revel application
	build       build a Revel application (e.g. for deployment)
	package     package a Revel application (e.g. for deployment)
	clean       clean a Revel application's temp files
	test        run all tests from the command-line
	version     displays the Revel Framework and Go version

Use "revel help [command]" for more information.

Quick Ref

  • Please refer to the tool’s built-in help (revel -h) for the latest information on the individual commands.
NOTE: If not specified, the run_mode on all commands defaults to dev

revel new [import_path] [skeleton]

Creates a few files to get a new Revel application running quickly.

  • Copies files from the revel/skeleton directory
  • Under multi GOPATH scenario, Revel detects the current working directory with GOPATH and generates the project
  • Skeleton is an optional argument, provided as an alternate skeleton path
revel new bitbucket.org/myorg/my-app

revel run [import_path] [run_mode] [port]

// run in dev mode
revel run github.com/mycorp/mega-app

// run in prod mode on port 9999
revel run github.com/mycorp/mega-app prod 9999

revel build [import_path] [target_path] [run_mode]

  • Build the Revel web application named by the given import path.
  • This allows it to be deployed and run on a machine that lacks a Go installation.
    revel build github.org/mememe/mega-app /path/to/deploy/mega-app prod
WARNING: The target path will be completely deleted, if it already exists!

revel package [import_path] [run_mode]

  • Build the Revel web application named by the given import path.
  • This allows it to be deployed and run on a machine that lacks a Go installation.
    revel package github.com/revel/revel/samples/chat prod
    > Your archive is ready: chat.tar.gz
WARNING: The target path will be completely deleted, if it already exists!

revel clean [import_path]

  • Clean the Revel web application named by the given import path
  • Deletes the app/tmp directory.
  • Deletes the app/routes directory.
    revel clean github.com/revel/samples/booking

revel test [import_path] [run_mode] [suite.method]

  • Run all tests for the Revel app named by the given import path.
    revel test github.com/revel/samples/booking dev

revel version

  • Displays the Revel Framework and Go version.
    revel version