mirror of
https://github.com/TiddlyWiki/TiddlyWiki5.git
synced 2026-04-28 00:14:42 +00:00
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
This commit is contained in:
26
plugins/tiddlywiki/aws/templates/lambda/handler.tid
Normal file
26
plugins/tiddlywiki/aws/templates/lambda/handler.tid
Normal file
@@ -0,0 +1,26 @@
|
||||
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");
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user