mirror of
https://github.com/yeslayla/haxe-lambda-example.git
synced 2025-07-27 08:45:43 +02:00
Initial commit
This commit is contained in:
3
ReadMe.md
Normal file
3
ReadMe.md
Normal file
@ -0,0 +1,3 @@
|
||||
# Haxe Lambda Example
|
||||
|
||||
Extremely simple Haxe project that runs as a JavaScript function on AWS Lambda.
|
3
compile.hxml
Normal file
3
compile.hxml
Normal file
@ -0,0 +1,3 @@
|
||||
-cp src
|
||||
--js export/handler.js
|
||||
--main Handler
|
1
export/.gitignore
vendored
Normal file
1
export/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
handler.js
|
5
export/index.js
Normal file
5
export/index.js
Normal file
@ -0,0 +1,5 @@
|
||||
const handler = require("handler");
|
||||
|
||||
exports.handler = async function(event, context, callback) {
|
||||
return handler.Handler.handler(event,context,callback);
|
||||
}
|
15
src/Handler.hx
Normal file
15
src/Handler.hx
Normal file
@ -0,0 +1,15 @@
|
||||
|
||||
@:expose
|
||||
class Handler {
|
||||
static function main() {} // Main is not called
|
||||
|
||||
static function handler(event : {source : String}, context : {functionName : String}) : String {
|
||||
|
||||
// Run your Haxe code
|
||||
var eventSource : String = event.source;
|
||||
var lambdaName : String = context.functionName;
|
||||
|
||||
// Return response
|
||||
return 'Hello to $eventSource from $lambdaName!';
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user