{"id":26916202,"url":"https://github.com/ortus-boxlang/boxlang-aws-lambda","last_synced_at":"2026-04-16T23:31:53.236Z","repository":{"id":239817926,"uuid":"784435914","full_name":"ortus-boxlang/boxlang-aws-lambda","owner":"ortus-boxlang","description":"The official BoxLang AWS Lambda runtime","archived":false,"fork":false,"pushed_at":"2024-09-13T11:20:51.000Z","size":167,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":7,"default_branch":"development","last_synced_at":"2024-09-14T01:14:00.099Z","etag":null,"topics":["aws","boxlang","java","lambda","serverless"],"latest_commit_sha":null,"homepage":"https://boxlang.ortusbooks.com/getting-started/running-boxlang/aws-lambda","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ortus-boxlang.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.YML","license":null,"code_of_conduct":".github/CODE_OF_CONDUCT.MD","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":".github/SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"ortussolutions"}},"created_at":"2024-04-09T21:09:37.000Z","updated_at":"2024-09-13T11:20:55.000Z","dependencies_parsed_at":"2024-08-23T14:37:12.009Z","dependency_job_id":"0e9a71ed-38bb-4a7a-ada8-bcba9ca54a0b","html_url":"https://github.com/ortus-boxlang/boxlang-aws-lambda","commit_stats":null,"previous_names":["ortus-boxlang/boxlang-aws-lambda"],"tags_count":29,"template":false,"template_full_name":"ortus-boxlang/boxlang-module-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortus-boxlang%2Fboxlang-aws-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortus-boxlang%2Fboxlang-aws-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortus-boxlang%2Fboxlang-aws-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ortus-boxlang%2Fboxlang-aws-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ortus-boxlang","download_url":"https://codeload.github.com/ortus-boxlang/boxlang-aws-lambda/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246696548,"owners_count":20819456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","boxlang","java","lambda","serverless"],"created_at":"2025-04-01T18:52:22.709Z","updated_at":"2026-04-16T23:31:53.215Z","avatar_url":"https://github.com/ortus-boxlang.png","language":"Java","funding_links":["https://patreon.com/ortussolutions"],"categories":[],"sub_categories":[],"readme":"# ⚡︎ BoxLang AWS Lambda Runtime\n\n```\n|:------------------------------------------------------:|\n| ⚡︎ B o x L a n g ⚡︎\n| Dynamic : Modular : Productive\n|:------------------------------------------------------:|\n```\n\n\u003cblockquote\u003e\n\tCopyright Since 2023 by Ortus Solutions, Corp\n\t\u003cbr\u003e\n\t\u003ca href=\"https://www.boxlang.io\"\u003ewww.boxlang.io\u003c/a\u003e |\n\t\u003ca href=\"https://www.ortussolutions.com\"\u003ewww.ortussolutions.com\u003c/a\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\n## 🚀 Welcome to the BoxLang AWS Lambda Runtime\n\nThis repository contains the **core AWS Lambda Runtime** for the BoxLang language. This runtime acts as a bridge between AWS Lambda's Java 21 runtime and BoxLang's dynamic language features, enabling BoxLang code execution in serverless environments.\n\n**✨ Key Features:**\n\n- **🎯 Automatic URI Routing** - Route requests to specific BoxLang classes based on URI paths\n- **⚡ Performance Optimized** - Class compilation caching and connection pooling\n- **🔄 Multiple Event Sources** - API Gateway, Function URLs, ALB, and direct invocations\n- **🧪 Developer Friendly** - Hot reloading, comprehensive debugging, and local testing\n\n\u003e 💡 **For creating Lambda projects**: Use our [BoxLang AWS Lambda Template](https://github.com/ortus-boxlang/bx-aws-lambda-template) to quickly bootstrap new serverless applications.\n\n## 🏗️ Architecture Overview\n\nThe runtime consists of:\n\n- **`ortus.boxlang.runtime.aws.LambdaRunner`** - Main AWS Lambda RequestHandler\n- **Dynamic Class Compilation** - Compiles `.bx` files on-demand with intelligent caching\n- **Convention-based Execution** - Executes `Lambda.bx` files via the `run()` method\n- **Flexible Response Handling** - Supports both direct returns and response struct population\n\n### 🔄 Runtime Flow\n\n1. **Static Initialization** - BoxLang runtime loads once per Lambda container\n2. **URI-based Class Resolution** - Automatically routes requests to specific BoxLang classes based on URI path\n3. **Class Compilation** - `.bx` files are compiled and cached for performance\n4. **Method Resolution** - Discovers target method via convention or `x-bx-function` header\n5. **Application Lifecycle** - Full Application.bx lifecycle with onRequestStart/End\n6. **Response Marshalling** - Converts BoxLang responses to Lambda-compatible JSON\n\n## 🎯 URI-Based Routing\n\nThe runtime supports **automatic class routing** based on incoming URI paths, making it easy to build multi-resource APIs without configuration.\n\n### How It Works\n\nWhen a request comes in, the runtime:\n\n1. **Extracts the URI path** from various event types (API Gateway, Function URLs, ALB)\n2. **Converts the first path segment** to PascalCase using BoxLang's built-in StringUtil\n3. **Looks for a matching `.bx` class** in the Lambda deployment root\n4. **Falls back to `Lambda.bx`** if no specific class is found\n\n### URI to Class Mapping Examples\n\n| Incoming URI | BoxLang Class | Description |\n|--------------|---------------|-------------|\n| `/products` | `Products.bx` | Product management endpoints |\n| `/customers` | `Customers.bx` | Customer management endpoints |\n| `/user-profiles` | `UserProfiles.bx` | Handles hyphenated URIs |\n| `/api_endpoints` | `ApiEndpoints.bx` | Handles underscored URIs |\n| `/orders/123` | `Orders.bx` | Routes based on first segment only |\n| `/unknown/path` | `Lambda.bx` | Falls back to default when class not found |\n\n### Creating Route Classes\n\nSimply create a `.bx` file with the PascalCase name of your resource:\n\n```boxlang\n// Products.bx - Handles all /products/* requests\nclass {\n    function run( event, context, response ) {\n        var httpMethod = event.requestContext?.http?.method ?: event.httpMethod ?: \"GET\";\n        var pathParameters = event.pathParameters ?: {};\n\n        switch( httpMethod ) {\n            case \"GET\":\n                if( structKeyExists( pathParameters, \"id\" ) ) {\n                    return getProduct( pathParameters.id );\n                } else {\n                    return getAllProducts();\n                }\n                break;\n            case \"POST\":\n                return createProduct( event.body );\n                break;\n            // ... handle other HTTP methods\n        }\n    }\n\n    private function getAllProducts() {\n        return {\n            \"message\": \"Fetching all products\",\n            \"data\": [\n                { \"id\": 1, \"name\": \"Product 1\", \"price\": 29.99 }\n            ]\n        };\n    }\n\n    private function getProduct( id ) {\n        return {\n            \"message\": \"Fetching product ##\" \u0026 id,\n            \"data\": { \"id\": id, \"name\": \"Product \" \u0026 id }\n        };\n    }\n}\n```\n\n### Multi-Method Support\n\nYou can still use the `x-bx-function` header to call specific methods within your route classes:\n\n```bash\n# Call the 'run' method (default)\ncurl -X GET /products\n\n# Call a custom method\ncurl -X GET /products -H \"x-bx-function: getActiveProducts\"\n```\n\n### Event Type Support\n\nURI routing works with all AWS event sources:\n\n- **API Gateway v1.0** (REST API) - Uses `path` field\n- **API Gateway v2.0** (HTTP API) - Uses `requestContext.http.path` field\n- **Lambda Function URLs** - Uses `rawPath` field\n- **Application Load Balancer** - Uses `path` field with `requestContext.elb`\n- **Direct Invocations** - Falls back to `Lambda.bx`\n\n### Benefits\n\n- **🚀 Zero Configuration** - Just create `.bx` files, no routing setup required\n- **📁 Clean Organization** - Separate classes for different resources/domains\n- **🔄 Backward Compatible** - Existing `Lambda.bx` files continue to work\n- **⚡ Performance Optimized** - Classes are compiled once and cached\n- **🧪 Easy Testing** - Test individual resource classes in isolation\n\n## 🛠️ Development Setup\n\n### Prerequisites\n\n- **Java 21+** - Required for BoxLang runtime\n- **AWS CLI** - For deployment and testing\n- **AWS SAM CLI** - For local development and testing\n- **Docker** - Required by SAM for local Lambda emulation\n\n### Local Development\n\n```bash\n# Clone the runtime repository\ngit clone https://github.com/ortus-boxlang/boxlang-aws-lambda.git\ncd boxlang-aws-lambda\n\n# Build the runtime\n./gradlew build shadowJar\n\n# Create deployment packages\n./gradlew buildMainZip buildTestZip\n\n# Run tests\n./gradlew test\n\n# Local testing with SAM\nsam local invoke bxFunction --event=workbench/sampleEvents/api.json\n```\n\n### 🏃‍♂️ Performance Testing\n\nRun comprehensive performance benchmarks:\n\n```bash\n# Execute performance test suite\n./workbench/performance-test.sh\n\n# Quick validation test\n./workbench/simple-test.sh\n```\n\n## 🧩 Core Components\n\n### LambdaRunner.java\n\nThe main entry point implementing AWS Lambda's `RequestHandler\u003cMap\u003cString, Object\u003e, Object\u003e`:\n\n- **Static Initialization** - BoxLang runtime loads once per container\n- **Class Caching** - Compiled BoxLang classes cached via `ConcurrentHashMap`\n- **Performance Metrics** - Debug timing for compilation and execution\n- **Connection Pooling** - Configurable connection pool sizes\n\n### Environment Variables\n\nRuntime behavior is controlled via environment variables:\n\n- `BOXLANG_LAMBDA_CLASS` - Override default `Lambda.bx` class path\n- `BOXLANG_LAMBDA_DEBUGMODE` - Enable debug logging and performance metrics\n- `BOXLANG_LAMBDA_CONFIG` - Custom BoxLang configuration path (default: `/var/task/boxlang.json`)\n- `BOXLANG_LAMBDA_CONNECTION_POOL_SIZE` - Connection pool size (default: 2)\n- `LAMBDA_TASK_ROOT` - Lambda deployment root (default: `/var/task`)\n\n### Build System (Gradle)\n\nKey build tasks:\n\n- `build` - Builds, tests and packages\n- `shadowJar` - Creates fat JAR with all dependencies\n- `buildMainZip` - Packages deployable Lambda runtime + sample + all `.bx` route classes\n- `buildTestZip` - Creates test package for validation\n- `spotlessApply` - Code formatting and linting\n\n**Note:** The build system automatically includes all `.bx` files from `src/main/resources/` in the deployment package to support URI routing.\n\n## 🔬 Testing Infrastructure\n\n### Sample Events\n\nThe `workbench/sampleEvents/` directory contains test payloads:\n\n**Core Events:**\n\n- `api.json` - API Gateway integration event\n- `event.json` - Simple Lambda event\n- `health.json` - Health check event\n- `large-payload.json` - Large payload stress test\n\n**URI Routing Examples:**\n\n- `products-get-all.json` - GET `/products` → Routes to `Products.bx`\n- `products-get-one.json` - GET `/products/123` → Routes to `Products.bx` with ID parameter\n- `customers-get-all.json` - GET `/customers` → Routes to `Customers.bx`\n- `user-profiles-test.json` - GET `/user-profiles` → Routes to `UserProfiles.bx` (hyphenated example)\n\n### Unit Tests\n\nTests are located in `src/test/java/ortus/boxlang/runtime/aws/`:\n\n- **LambdaRunnerTest** - Core runtime functionality\n- **Performance Tests** - Class caching and optimization validation\n- **Integration Tests** - Full Lambda lifecycle testing\n\n### Local Testing with SAM\n\n```bash\n# Test traditional Lambda.bx (fallback behavior)\nsam local invoke bxFunction --event=workbench/sampleEvents/api.json\n\n# Test URI routing to Products.bx\nsam local invoke bxFunction --event=workbench/sampleEvents/products-get-all.json\n\n# Test URI routing to Customers.bx\nsam local invoke bxFunction --event=workbench/sampleEvents/customers-get-all.json\n\n# Test URI routing with path parameters\nsam local invoke bxFunction --event=workbench/sampleEvents/products-get-one.json\n\n# Test hyphenated URI routing (user-profiles → UserProfiles.bx)\nsam local invoke bxFunction --event=workbench/sampleEvents/user-profiles-test.json\n\n# Test with debug logging\nsam local invoke bxFunction --event=workbench/sampleEvents/products-get-all.json --debug\n```\n\n## ⚡ Performance Optimizations\n\n### Class Compilation Caching\n\nThe runtime implements intelligent caching to avoid recompilation:\n\n```java\nprivate static final ConcurrentHashMap\u003cString, Class\u003c?\u003e\u003e classCache = new ConcurrentHashMap\u003c\u003e();\n\nprivate Class\u003c?\u003e getOrCompileLambda(String lambdaClassPath) {\n    return classCache.computeIfAbsent(lambdaClassPath, path -\u003e {\n        // Compilation logic here\n    });\n}\n```\n\n### Performance Metrics\n\nWhen `BOXLANG_LAMBDA_DEBUGMODE=true`, the runtime logs:\n\n- Compilation time vs cache retrieval\n- Method execution duration\n- Memory usage patterns\n- Connection pool statistics\n\n### Best Practices for Contributors\n\n- **Minimize Cold Start Impact** - Keep static initialization lightweight\n- **Cache Aggressively** - Store expensive computations in static variables\n- **Profile Memory Usage** - Monitor CloudWatch logs for memory patterns\n- **Early Validation** - Fail fast on invalid inputs to reduce execution time\n\n## 🏗️ Build \u0026 Deployment\n\n### Creating Runtime Distributions\n\n```bash\n# Build all artifacts\n./gradlew clean build shadowJar buildMainZip buildTestZip\n\n# Artifacts created in build/distributions/:\n# - boxlang-aws-lambda-{version}-all.jar (fat JAR)\n# - boxlang-aws-lambda-{version}.zip (deployable package)\n# - boxlang-aws-lambda-test-{version}.zip (test package)\n```\n\n### Versioning\n\n- **Development Branch** - Versions append `-snapshot`\n- **Release Branches** - Clean semantic versions\n- **Checksums** - SHA-256 and MD5 generated for all artifacts\n\n### Dependencies\n\nThe runtime automatically handles BoxLang dependencies:\n\n- **Local Development** - Uses `../boxlang/build/libs/boxlang-*.jar` if available\n- **CI/CD** - Downloads dependencies to `src/test/resources/libs/`\n- **Web Support** - Includes `boxlang-web-support` for HTTP utilities\n\n## 🧪 Contributing Guidelines\n\n### Development Workflow\n\n1. **Fork \u0026 Clone** - Create your development environment\n2. **Feature Branch** - Create branch from `development`\n3. **Build \u0026 Test** - Ensure all tests pass locally\n4. **Performance Test** - Run performance benchmarks\n5. **Code Quality** - Run `./gradlew spotlessApply` for formatting\n6. **Pull Request** - Target the `development` branch\n\n### Code Standards\n\n- **Java 21** - Use modern Java features appropriately\n- **BoxLang Integration** - Follow BoxLang runtime patterns\n- **Performance First** - Consider Lambda cold start implications\n- **Documentation** - Update relevant docs and comments\n- **Testing** - Add tests for new functionality\n\n### URI Routing Development\n\nWhen working on URI routing features:\n\n- **Use BoxLang Built-ins** - Leverage `ortus.boxlang.runtime.types.util.StringUtil` for string operations\n- **Test All Event Types** - Ensure compatibility with API Gateway v1/v2, Function URLs, and ALB\n- **Handle Edge Cases** - Test with various URI patterns (hyphens, underscores, nested paths)\n- **Maintain Fallback** - Always ensure `Lambda.bx` fallback behavior works\n- **Add Sample Events** - Create corresponding test events in `workbench/sampleEvents/`\n\n### Debugging Runtime Issues\n\n1. **Enable Debug Mode** - Set `BOXLANG_LAMBDA_DEBUGMODE=true`\n2. **Check CloudWatch Logs** - Look for compilation/execution metrics\n3. **Local SAM Testing** - Use `sam local invoke --debug`\n4. **Unit Test Isolation** - Create focused tests for specific issues\n\n## 📚 Additional Resources\n\n### BoxLang Documentation\n\n- **Main Documentation** - [boxlang.ortusbooks.com](https://boxlang.ortusbooks.com)\n- **AWS Lambda Guide** - [BoxLang Lambda Documentation](https://boxlang.ortusbooks.com/getting-started/running-boxlang/aws-lambda)\n- **IDE Tooling** - [Development Tools](https://boxlang.ortusbooks.com/getting-started/ide-tooling)\n\n### Related Projects\n\n- **Lambda Template** - [bx-aws-lambda-template](https://github.com/ortus-boxlang/bx-aws-lambda-template)\n- **BoxLang Core** - [boxlang](https://github.com/ortus-boxlang/boxlang)\n- **Web Support** - [boxlang-web-support](https://github.com/ortus-boxlang/boxlang-web-support)\n\n---\n\n## 📖 BoxLang Information\n\nBoxLang is a modern, dynamic JVM language that can be deployed on multiple runtimes: operating system (Windows/Mac/*nix/Embedded), web server, lambda, iOS, android, web assembly, etc.\n\n**BoxLang Features:**\n\n- Be a rapid application development (RAD) scripting language and middleware.\n- Unstagnate the dynamic language ecosystem in Java.\n- Be dynamic, modular, lightweight, and fast.\n- Be 100% interoperable with Java.\n- Be modern, functional, and fluent (Think mixing CFML, Node, Kotlin, Java, and Clojure)\n- Be able to support multiple runtimes and deployment targets:\n  - Native OS Binaries (CLI Tooling, compilers, etc.)\n  - MiniServer\n  - Servlet Containers - CommandBox/Tomcat/Jetty/JBoss\n  - JSR223 Scripting Engines\n  - AWS Lambda\n  - Microsoft Azure Functions (Coming Soon)\n  - Android/iOS Devices (Coming Soon)\n  - Web assembly (Coming Soon)\n- Compile down to Java ByteCode\n- Allow backward compatibility with the existing ColdFusion/CFML language.\n- Great IDE, Debugger and Tooling: https://boxlang.ortusbooks.com/getting-started/ide-tooling\n- Scripting (Any OS and Shebang) and REPL capabilities\n\n## 💰 Professional Support \u0026 Services\n\nGet professional support, training, and custom development services for your BoxLang applications:\n\n- Professional Support and Priority Queuing\n- Remote Assistance and Troubleshooting\n\nYou can find our docs here: https://boxlang.ortusbooks.com/\n\n## License\n\nApache License, Version 2.0.\n\n## Open-Source \u0026 Professional Support\n\nThis project is a professional open source project and is available as FREE and open source to use.  Ortus Solutions, Corp provides commercial support, training and commercial subscriptions which include the following:\n\n- Professional Support and Priority Queuing\n- Remote Assistance and Troubleshooting\n- New Feature Requests and Custom Development\n- Custom SLAs\n- Application Modernization and Migration Services\n- Performance Audits\n- Enterprise Modules and Integrations\n- Much More\n\n\u003cp\u003e\u0026nbsp;\u003c/p\u003e\n\n\u003cblockquote\u003e\n\"We ❤️ Open Source and BoxLang\" - Luis Majano\n\u003c/blockquote\u003e\n\n---\n\n## ⭐ Star Us\n\nPlease star us if this runtime helps you build amazing serverless applications with BoxLang!\n\n---\n\n## 🙏 Sponsors\n\nA huge thanks to our sponsors who help us continue developing BoxLang and its ecosystem:\n\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://www.ortussolutions.com\"\u003e\u003cimg src=\"https://www.ortussolutions.com/__media/ortus-medium.png\" alt=\"Ortus Solutions\" width=\"300\"/\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ by the BoxLang Team\u003cbr/\u003e\n  Copyright Since 2023 by \u003ca href=\"https://www.ortussolutions.com\"\u003eOrtus Solutions, Corp\u003c/a\u003e\n\u003c/p\u003e\n\nVisit us at [BoxLang.io Plans](https://boxlang.io/plans) for more information.\n\n## Usage\n\nTo use it, you need to create a Lambda function and specify `Java 21` as the runtime. The class that executes your BoxLang code is `ortus.boxlang.runtime.aws.LambdaRunner`. By convention it will execute a `Lambda.bx` file in the root (`/var/task/Lambda.bx`) of the Lambda function, via the `run()` method. The method signature can look like this:\n\n```java\n// Lambda.bx\nclass{\n\n\tfunction run( event, context, response ){\n\t\t// Your code here\n\t}\n\n}\n```\n\n- The `event` parameter is the event data that is passed to the Lambda function as a `Struct`.\n- The `context` parameter is the context object that is passed to the Lambda function. This matches the AWS Lambda context object: `com.amazonaws.services.lambda.runtime.Context`.\n- The `response` parameter is the response object that is passed to the Lambda function.\n\n### Response Struct\n\nThe `response` object is a `Struct` that you can use to set the response data. The `response` object has the following keys:\n\n- `statusCode` : The HTTP status code for the response.\n- `headers` : A `Struct` of headers to send in the response.\n- `body` : The body of the response, which can be anything.\n\nThe BoxLang lambda runner will return the `response` object as the response to the Lambda function as a JSON object.\n\n### Testing the Lambda Locally\n\n#### Build\n\n```\ngradle shadowJar\ngradle buildMainZip\n```\n\n#### AWS Sam CLI\n\n##### Installing AWS Sam CLI\n\nhttps://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html\n\n#### Invoking your Lambda Locally with Sample Event Data\n\n```\nsam local invoke bxFunction --event=workbench/sampleEvents/api.json\nsam local invoke bxFunction --event=workbench/sampleEvents/event.json\n```\n\n#### Invoking your Lambda Locally with Debug Mode\n\n```\nsam local invoke bxFunction --event=workbench/sampleEvents/api.json --debug\nsam local invoke bxFunction --event=workbench/sampleEvents/event.json --debug\n```\n\n### Custom Lambda Function\n\nIf you don't want to use the convention of `Lambda.bx` then you can setup an environment variable called `BOXLANG_LAMBDA_CLASS` with the full path to the BoxLang class that will execute your code. The class must have a `run()` method that matches the signature above.\n\n### Debug Mode\n\nYou can enable debug mode by setting the environment variable `BOXLANG_LAMBDA_DEBUG` to `true`. This will output debug information to the Lambda logs.\n\n### Example\n\nHere is an example of a simple Lambda function that returns a `Hello World` response:\n\n```java\n// Lambda.bx\nclass{\n\n\tfunction run( event, context, response ){\n\t\t// response.statusCode = 200; set by default\n\t\tresponse.headers = {\n\t\t\t\"Content-Type\" : \"text/plain\"\n\t\t};\n\t\tresponse.body = \"Hello World\";\n\t}\n\n}\n```\n\nHowever, if you don't even want to deal with the `response` struct, you can just use a return and whatever you return will be placed for you in the `response.body`.\n\n```java\n// Lambda.bx\nclass{\n\n\tfunction run( event, context ){\n\t\treturn \"Hello World\";\n\t}\n\n}\n```\n\n\n## ⭐ Star Us\n\nPlease star us if this runtime helps you build amazing serverless applications with BoxLang!\n\n[![GitHub Stars](https://img.shields.io/github/stars/ortus-boxlang/boxlang-aws-lambda?style=social)](\n\n\n## Ortus Sponsors\n\nBoxLang is a professional open-source project and it is completely funded by the [community](https://patreon.com/ortussolutions) and [Ortus Solutions, Corp](https://www.ortussolutions.com). Ortus Patreons get many benefits like a cfcasts account, a FORGEBOX Pro account and so much more. If you are interested in becoming a sponsor, please visit our patronage page: [https://patreon.com/ortussolutions](https://patreon.com/ortussolutions)\n\n### THE DAILY BREAD\n\n\u003e \"I am the way, and the truth, and the life; no one comes to the Father, but by me (JESUS)\" Jn 14:1-12\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fortus-boxlang%2Fboxlang-aws-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fortus-boxlang%2Fboxlang-aws-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fortus-boxlang%2Fboxlang-aws-lambda/lists"}