boxlang-web-developmentlisted
Install: claude install-skill ortus-boxlang/skills
# BoxLang Web Development
## Overview
BoxLang web applications revolve around `Application.bx`, which acts as the
application lifecycle controller. The runtime handles HTTP requests through a
well-defined lifecycle, with full support for REST, sessions, CSRF, SSE, and
both MiniServer (dev) and CommandBox (production) deployment.
For a deep dive into multi-app isolation, descriptor discovery, and advanced
`Application.bx` patterns, see the
[`application-descriptor`](../application-descriptor/SKILL.md) skill.
## Application.bx
`Application.bx` lives at the web root and configures the entire application:
```boxlang
// Application.bx
class {
// Application settings
this.name = "MyApp"
this.sessionManagement = true
this.sessionTimeout = createTimeSpan( 0, 2, 0, 0 ) // 2 hours
this.applicationTimeout = createTimeSpan( 1, 0, 0, 0 ) // 1 day
this.setClientCookies = true
// Java classpath additions
this.javaSettings = {
loadPaths: [ "lib/" ],
loadColdFusionClassPath: false,
reloadOnChange: false
}
// Datasource defaults
this.datasource = "mainDB"
// --- Lifecycle Events ---
// Fires once when the application first starts
boolean function onApplicationStart() {
application.version = "1.0.0"
application.config = loadConfig()
return true
}
// Fires before every request
boolean function onRequestStart( required string targetPage ) {
// Auth