boxlang-runtime-google-cloud-functionslisted
Install: claude install-skill ortus-boxlang/skills
# BoxLang on Google Cloud Functions
## Overview
BoxLang runs on Google Cloud Functions Gen 2 via the Java 21 runtime. The
`FunctionRunner` bridge handles HTTP request mapping, handler routing, class
caching, and response serialization — so you focus on writing BoxLang handler files.
---
## Architecture
```
HTTP Request
→ GCF Gen 2 (java21 runtime)
→ FunctionRunner (HttpFunction)
→ RequestMapper (HttpRequest → BoxLang event struct)
→ Route resolution (first URI segment → PascalCase → .bx file)
→ Handler compilation + class cache (warm invocations)
→ Method dispatch (run() or x-bx-function header)
→ BoxLang handler execution
→ ResponseMapper (response struct → HttpResponse)
```
**Runtime entry point:**
```
ortus.boxlang.runtime.gcp.FunctionRunner
```
---
## Starter Project
```bash
git clone https://github.com/ortus-boxlang/boxlang-starter-google-functions.git
cd boxlang-starter-google-functions
# Verify environment
./gradlew clean test
```
---
## Handler File Convention
Handlers live in `src/main/bx/`. The URI path maps to a PascalCase `.bx` file:
| Request URI | Resolved handler |
|------------|----------------|
| `GET /` | `src/main/bx/Index.bx` |
| `GET /orders` | `src/main/bx/Orders.bx` |
| `POST /users` | `src/main/bx/Users.bx` |
Each handler file is a BoxLang class with a `run()` method:
```boxlang
// src/main/bx/Orders.bx
class {
/**
* Main GCF handler.
*
* @param event HTTP event struct: { metho