Called upon startup of the server. Typically defined in server.cfc and placed at the webroot. In the ColdFusion Administrator > Setting check 'Component with onServerStart() method' and specify the file. The function is useful for application-independent tasks, and specifying the server specific environment variables and other general tasks.
function onServerStart() { }
→ returns void
Setting server specific variables
<cfcomponent> <cffunction name="onServerStart"> <cfset server.environment = "Dev-Server"> <cfset server.tech_support = "joe.bloggs@example.com"> </cffunction></cfcomponent>
Signup for cfbreak
to stay updated on the latest news from the ColdFusion / CFML community. One email, every friday.