This is a creation in Article, where the information may have evolved or changed.
First download Revel
go get -u github.com/revel/cmd/revel
Create an App
#假设GOPATH = /GOPATHcd /GOPATHrevel new coding.net/revel-example
The above command creates an app named Coding.net/revel-example.
Launch app
revel run coding.net/revel-example
Open the browser and you can see and work
Screen shot 2017-09-08 a.m. 11.25.03.png
The directory structure you see at this point is like this
ls -alhtotal 8.0Kdrwxr-xr-x 9 lamo 306 9 8 11:23 .drwxr-xr-x 3 lamo 102 9 8 11:23 ..-rw-r--r-- 1 lamo 27 9 8 11:23 .gitignore-rw-r--r-- 1 lamo 1.2K 9 8 11:23 README.mddrwxr-xr-x 7 lamo 238 9 8 11:24 appdrwxr-xr-x 4 lamo 136 9 8 11:23 confdrwxr-xr-x 3 lamo 102 9 8 11:23 messagesdrwxr-xr-x 6 lamo 204 9 8 11:23 publicdrwxr-xr-x 3 lamo 102 9 8 11:23 tests
The app is the main program logic and data structure, revel will automatically monitor the directory under the source file changes, and then automatically compiled. Directories other than this directory are not compiled automatically.
Conf Main storage configuration file
Messages main store i18n related files
Public main store front-end files
Tests mainly store test files