Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ashkyd/fliteral
Node app for running Lambda-like functions
https://github.com/ashkyd/fliteral
Last synced: 4 days ago
JSON representation
Node app for running Lambda-like functions
- Host: GitHub
- URL: https://github.com/ashkyd/fliteral
- Owner: AshKyd
- Created: 2017-05-15T13:14:51.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-06-09T06:45:17.000Z (over 7 years ago)
- Last Synced: 2024-11-10T14:48:47.597Z (2 months ago)
- Language: JavaScript
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Function literal runner
=======================A small Node app to run function literals, largely compatible with AWS Lambda + web gateway.
Use it for testing, or use it on your own server.
> Do not allow untrusted code to run on your infrastructure. These are not sandboxed in any way.
Literals
--------
These are really just Node modules with a standardised API. A literal consists of a folder, a package.json and an export.Sample literal to echo response back to sender:
```
module.exports = {
handler: (event, context, callback) => {
callback(null, {
statusCode: '200',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(event),
});
}
}
```Usage
-----
Run on the command line as follows:```
LITERAL_PATH=foo fliteral
```This will open the default HTTP port (see below), and any requests to
`http://myserver/*` will run & return the literal named `*`.Environment Variables
---------------------
The following variables may be configured:Variable name | Description | Default
----------------|----------------------|---------------------
PORT | HTTP port to open | 8080
LITERAL_PATH | Path which contains function literals. | `path.join(__dirname, functions)`
LITERAL_TIMEOUT | Number of milliseconds after which the server will send a 502 gateway timeout. | 15000
LITERAL_LOGGLY_TOKEN | Optional: Loggly token to remote log
LITERAL_LOGGLY_SUBDOMAIN | Optional: Loggly subdomain to remote log
LITERAL_LOGGLY_TAG | Optional: Tag to log entries to loggly