Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Coldbox.cfc 6.6 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
  1. component {
  2. /**
  3. * Configure the ColdBox App For Production
  4. * https://coldbox.ortusbooks.com/getting-started/configuration
  5. */
  6. function configure(){
  7. /**
  8. * --------------------------------------------------------------------------
  9. * ColdBox Directives
  10. * --------------------------------------------------------------------------
  11. * Here you can configure ColdBox for operation. Remember tha these directives below
  12. * are for PRODUCTION. If you want different settings for other environments make sure
  13. * you create the appropriate functions and define the environment in your .env or
  14. * in the `environments` struct.
  15. */
  16. coldbox = {
  17. // Application Setup
  18. appName : getSystemSetting( "APPNAME", "Your app name here" ),
  19. eventName : "event",
  20. // Development Settings
  21. reinitPassword : "",
  22. reinitKey : "fwreinit",
  23. handlersIndexAutoReload : true,
  24. // Implicit Events
  25. defaultEvent : "",
  26. requestStartHandler : "Main.onRequestStart",
  27. requestEndHandler : "",
  28. applicationStartHandler : "Main.onAppInit",
  29. applicationEndHandler : "",
  30. sessionStartHandler : "",
  31. sessionEndHandler : "",
  32. missingTemplateHandler : "",
  33. // Extension Points
  34. applicationHelper : "includes/helpers/ApplicationHelper.cfm",
  35. viewsHelper : "",
  36. modulesExternalLocation : [],
  37. viewsExternalLocation : "",
  38. layoutsExternalLocation : "",
  39. handlersExternalLocation : "",
  40. requestContextDecorator : "",
  41. controllerDecorator : "",
  42. // Error/Exception Handling
  43. invalidHTTPMethodHandler : "",
  44. exceptionHandler : "main.onException",
  45. invalidEventHandler : "",
  46. customErrorTemplate : "",
  47. // Application Aspects
  48. handlerCaching : false,
  49. eventCaching : false,
  50. viewCaching : false,
  51. // Will automatically do a mapDirectory() on your `models` for you.
  52. autoMapModels : true,
  53. // Auto converts a json body payload into the RC
  54. jsonPayloadToRC : true
  55. };
  56. /**
  57. * --------------------------------------------------------------------------
  58. * Custom Settings
  59. * --------------------------------------------------------------------------
  60. */
  61. settings = {};
  62. /**
  63. * --------------------------------------------------------------------------
  64. * Environment Detection
  65. * --------------------------------------------------------------------------
  66. * By default we look in your `.env` file for an `environment` key, if not,
  67. * then we look into this structure or if you have a function called `detectEnvironment()`
  68. * If you use this setting, then each key is the name of the environment and the value is
  69. * the regex patterns to match against cgi.http_host.
  70. *
  71. * Uncomment to use, but make sure your .env ENVIRONMENT key is also removed.
  72. */
  73. // environments = { development : "localhost,^127\.0\.0\.1" };
  74. /**
  75. * --------------------------------------------------------------------------
  76. * Module Loading Directives
  77. * --------------------------------------------------------------------------
  78. */
  79. modules = {
  80. // An array of modules names to load, empty means all of them
  81. include : [],
  82. // An array of modules names to NOT load, empty means none
  83. exclude : []
  84. };
  85. /**
  86. * --------------------------------------------------------------------------
  87. * Application Logging (https://logbox.ortusbooks.com)
  88. * --------------------------------------------------------------------------
  89. * By Default we log to the console, but you can add many appenders or destinations to log to.
  90. * You can also choose the logging level of the root logger, or even the actual appender.
  91. */
  92. logBox = {
  93. // Define Appenders
  94. appenders : { coldboxTracer : { class : "coldbox.system.logging.appenders.ConsoleAppender" } },
  95. // Root Logger
  96. root : { levelmax : "INFO", appenders : "*" },
  97. // Implicit Level Categories
  98. info : [ "coldbox.system" ]
  99. };
  100. /**
  101. * --------------------------------------------------------------------------
  102. * Layout Settings
  103. * --------------------------------------------------------------------------
  104. */
  105. layoutSettings = { defaultLayout : "", defaultView : "" };
  106. /**
  107. * --------------------------------------------------------------------------
  108. * Custom Interception Points
  109. * --------------------------------------------------------------------------
  110. */
  111. interceptorSettings = { customInterceptionPoints : [] };
  112. /**
  113. * --------------------------------------------------------------------------
  114. * Application Interceptors
  115. * --------------------------------------------------------------------------
  116. * Remember that the order of declaration is the order they will be registered and fired
  117. */
  118. interceptors = [];
  119. /**
  120. * --------------------------------------------------------------------------
  121. * Module Settings
  122. * --------------------------------------------------------------------------
  123. * Each module has it's own configuration structures, so make sure you follow
  124. * the module's instructions on settings.
  125. *
  126. * Each key is the name of the module:
  127. *
  128. * myModule = {
  129. *
  130. * }
  131. */
  132. moduleSettings = {};
  133. /**
  134. * --------------------------------------------------------------------------
  135. * Flash Scope Settings
  136. * --------------------------------------------------------------------------
  137. * The available scopes are : session, client, cluster, ColdBoxCache, or a full instantiation CFC path
  138. */
  139. flash = {
  140. scope : "session",
  141. properties : {}, // constructor properties for the flash scope implementation
  142. inflateToRC : true, // automatically inflate flash data into the RC scope
  143. inflateToPRC : false, // automatically inflate flash data into the PRC scope
  144. autoPurge : true, // automatically purge flash data for you
  145. autoSave : true // automatically save flash scopes at end of a request and on relocations.
  146. };
  147. /**
  148. * --------------------------------------------------------------------------
  149. * App Conventions
  150. * --------------------------------------------------------------------------
  151. */
  152. conventions = {
  153. handlersLocation : "handlers",
  154. viewsLocation : "views",
  155. layoutsLocation : "layouts",
  156. modelsLocation : "models",
  157. eventAction : "index"
  158. };
  159. }
  160. /**
  161. * Development environment
  162. */
  163. function development(){
  164. // coldbox.customErrorTemplate = "/coldbox/system/exceptions/BugReport.cfm"; // static bug reports
  165. coldbox.customErrorTemplate = "/coldbox/system/exceptions/Whoops.cfm"; // interactive bug report
  166. }
  167. }
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...