Skip to content

Commit f3a422c

Browse files
committed
revel/config#4 related changes applied here
1 parent 7fc8c20 commit f3a422c

File tree

1 file changed

+20
-8
lines changed

1 file changed

+20
-8
lines changed

revel.go

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,18 @@ var (
4545
// Revel installation details
4646
RevelPath string // e.g. "/Users/robfig/gocode/src/revel"
4747

48-
// Where to look for templates and configuration.
49-
// Ordered by priority. (Earlier paths take precedence over later paths.)
48+
// Where to look for templates
49+
// Ordered by priority. (Earlier paths take precedence over later paths.)
5050
CodePaths []string
51-
ConfPaths []string
5251
TemplatePaths []string
5352

53+
// ConfPaths where to look for configurations
54+
// Config load order
55+
// 1. framework (revel/conf/*)
56+
// 2. application (conf/*)
57+
// 3. user supplied configs (...) - User configs can override/add any from above
58+
ConfPaths []string
59+
5460
Modules []Module
5561

5662
// Server config.
@@ -145,11 +151,17 @@ func Init(mode, importPath, srcPath string) {
145151
if ConfPaths == nil {
146152
ConfPaths = []string{}
147153
}
148-
ConfPaths = append(
149-
ConfPaths,
150-
path.Join(BasePath, "conf"),
151-
path.Join(RevelPath, "conf"),
152-
)
154+
155+
// Config load order
156+
// 1. framework (revel/conf/*)
157+
// 2. application (conf/*)
158+
// 3. user supplied configs (...) - User configs can override/add any from above
159+
ConfPaths := append(
160+
[]string{
161+
path.Join(RevelPath, "conf"),
162+
path.Join(BasePath, "conf"),
163+
},
164+
ConfPaths...)
153165

154166
TemplatePaths = []string{
155167
ViewsPath,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy