mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-19 08:14:50 +00:00
a346888213
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
41 lines
824 B
Plaintext
41 lines
824 B
Plaintext
title: $:/plugins/tiddlywiki/aws/lambda
|
|
|
|
! Template
|
|
|
|
The template [[$:/plugins/tiddlywiki/aws/lambdas/main]] transcludes everything required to render a TiddlyWiki as an AWS Lambda function.
|
|
|
|
The Lambda is build with this command:
|
|
|
|
```
|
|
tiddlywiki editions/aws --rendertiddler $:/plugins/tiddlywiki/aws/lambdas/main index.js text/plain
|
|
```
|
|
|
|
Or:
|
|
|
|
```
|
|
tiddlywiki editions/aws --build lambda
|
|
```
|
|
|
|
! Execution
|
|
|
|
The Lambda boot code looks for an array of tiddlers to load in `event.tiddlers`, and an array of commands to execute in `event.commands`. For example:
|
|
|
|
```
|
|
{
|
|
"commands": [
|
|
"--aws","s3-rendertiddler","HelloThere","eu-west-2","my-bucket-name","rendered.html"
|
|
],
|
|
"tiddlers": [
|
|
{
|
|
"title": "HelloThere",
|
|
"text": "Hello from {{Platform}}."
|
|
},
|
|
{
|
|
"title": "Platform",
|
|
"text": "TiddlyWiki"
|
|
}
|
|
]
|
|
}
|
|
|
|
```
|