title | layout |
---|---|
Getting Started |
tutorial |
Before you can use Revel, first you need to install Go.
- See the official Go installation guide.
If you have not created a GOPATH as part of the installation, do so now. The GOPATH
is a directory where all of your Go code will live. Here is one way of setting it up:
- Make a directory:
mkdir ~/gocode
- Tell Go to use that as your GOPATH:
export GOPATH=~/gocode
- Save your GOPATH so that it will apply to all future shell sessions:
echo export GOPATH=$GOPATH >> ~/.bash_profile
Note that depending on your shell, you may need to adjust (3) to write the export into a different configuration file (e.g. ~/.bashrc, *~/.zshrc, etc.).
Now your Go installation is complete.
Git and Mercurial are required to allow go get
to clone various dependencies.
To get the Revel framework, run
go install github.com/revel/cmd/revel@latest
This command does a couple of things:
- Go uses git to clone the repository into
$GOPATH/src/github.com/revel/revel/
- Go transitively finds all of the dependencies and runs
go get
on them as well.
The revel
command line tool is used
to build
, run
, and package
Revel applications.
Use go get
to install:
go get github.com/revel/cmd/revel
Ensure the $GOPATH/bin
directory is in your PATH so that you can reference the command from anywhere.
export PATH="$PATH:$GOPATH/bin"
Verify that it works:
$ revel
Usage:
revel [OPTIONS] <command>
Application Options:
-v, --debug If set the logger is set to verbose
--historic-run-mode If set the runmode is passed a string not json
--historic-build-mode If set the code is scanned using the original parsers, not the go.1.11+
-X, --build-flags= These flags will be used when building the application. May be specified multiple times, only applicable for Build, Run, Package, Test commands
--gomod-flags= These flags will execute go mod commands for each flag, this happens during the build process
Available commands:
build
clean
new
package
run
test
version