celastrina
Javascript Framework for simplifying Microsoft Azure Functions and supporting resources.
Who should use celastrina.js?
Right now, to receive the highest time-to-value, celastrina.js should be used in green-field application development.
While stable and well-supported, Celastrina.js has not been out in the wild very long; because of this, configurations
to support diverse deployments are not yet available. While extremely flexible and developer oriented, Celastrina.js is
still fairly rigid to its intended framework, using it on established or legacy projects usually requires a lot of
customization and code, potentially lowering your time-to-value.
Prerequisite
- You gotta know Azure, at least a little.
- You gotta know Javascript and Node.js, duh.
Quick-start
To use Celastring.js simply deploy the following to your Microsoft Azure HTTP Trigger function:
"use strict";
const {LOG_LEVEL, StringProperty, BooleanProperty, Configuration} = require("@celastrina/core");
const {JSONHTTPContext, JSONHTTPFunction} = require("@celastrina/http");
const config = new Configuration(new StringProperty("function.name"),
new BooleanProperty("function.managed"));
class MyNewHTTPTriggerFunction extends JSONHTTPFunction {
async _get(context) {
return new Promise((resolve, reject) => {
context.send({"message": "_get invoked."});
resolve();
});
}
async _post(context) {
return new Promise((resolve, reject) => {
context.send({"message": "_post invoked."});
resolve();
});
}
}
module.exports = new MyNewHTTPTriggerFunction(config);
function.json
Update you r Microsoft Azure function.json file with the following directive "entryPoint": "execute". Your in and out
bdinges should be named "req" and "res" respectively. Your function.json should look something like this:
{
"entryPoint": "execute",
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"get",
"post"
]
},
{
"type": "http",
"direction": "out",
"name": "res"
}
]
}
Detailed Help & Documentation
Please visit https://www.celastrinajs.com for complete documentation on using Celastrina.js.