Golang Revel Learning-Project structure

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

Revel is a typical MVC framework that uses the command Revel new [appname] to create a Revel project with the default structure:

App

| CONTROLLERS-MVC mode controller, receiving client request to complete the logical processing and return the rendered result-html,json,xml ...

| Routes-revel automatically generated route code, the URL that is configured in conf/routes and the mapping relationship of the controller is written to the code, to achieve static, I think this can improve performance after build, more efficient than full dynamic mapping, while simplifying development.

| TMP-Temp directory, typically only Mai.go, is a real main function of the Revel app, generated automatically by the Revel framework.

| Views-revel The application's view layer, the template to return the client-side page or data is here

| Init.go-the configuration of the filter applied globally is here

Conf

| APP.CONF application configuration file, the default setting of the global configuration items, as well as the dev and prod mode configuration, by the time you start to specify the parameters of Dev or prod, the application can switch configuration.

| Routes configure mapping between URL requests and background processing code, supporting regular expression matching

Messages

-

Public-static resource files can be placed here, icons, css,javascript ...

--CSS

--img

--JS

Tests-the directory where the test code is located

--Apptest.go



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.