1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-07-04 03:03:18 +00:00
TiddlyWiki5/plugins/tiddlywiki/aws/templates/lambda/handler.tid
Jermolene a346888213 Add first release of AWS plugin
Tools for working with Amazon Web Services:

* Templates for saving a TiddlyWiki as a single JavaScript file in a
ZIP file that can be executed as an AWS Lambda function. In this form,
TiddlyWiki is a self contained single file containing both code and
data, just like the standalone HTML file configuration
* Commands that can be used to interact with AWS services, under both
the Node.js and Lambda configurations of TiddlyWiki
2017-07-03 20:34:58 +01:00

27 lines
668 B
Plaintext

title: $:/plugins/tiddlywiki/aws/lambda/handler
type: text/plain
/*
TiddlyWiki for AWS
*/
exports.handler = function(event,context,callback) {
// Initialise the boot prefix
global.$tw = _bootprefix();
// Some default package info
$tw.packageInfo = lambdaPackageInfo;
// Load any tiddlers from the package
$tw.preloadTiddlerArray(lambdaTiddlers);
// Load any tiddlers from the event
if(event.tiddlers) {
$tw.preloadTiddlerArray(event.tiddlers);
}
// Load the commands from the event
$tw.boot.argv = (event.commands || []).slice(0);
// Boot the TW5 app
_boot($tw);
$tw.boot.boot(function() {
callback(null,"TiddlyWiki execution successful");
});
}