JSPM

lambda-framework-gcloud

1.2.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q31879F
  • License MIT

Google Cloud Functions implementation of Lambda Framework

Package Exports

  • lambda-framework-gcloud

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (lambda-framework-gcloud) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Google Cloud Functions implementation

Coverage Status Build Status npm version

Google Cloud Functions implementation of Lambda Framework.

How to use it?

Creating the Cloud Functions handler

import { App, IApp } from "lambda-framework";
import { GCloudHttpHandler, GCloudEventHandler } from "lambda-framework-gcloud";

const app: IApp = new App();
...
const httpHandler: GCloudHttpHandler = new GCloudHttpHandler(app);
export const httpHandle = httpHandler.handle.bind(httpHandler);

const eventHandler: GCloudEventHandler = new GCloudEventHandler(app);
export const eventHandle = eventHandler.handle.bind(eventHandler);

Using Cloud Storage to retrieve the templates

import { App, IApp, ITemplateRenderer } from "lambda-framework";
import { GCloudHttpHandler, GCloudEventHandler, GCloudStorageTemplateLoader } from "lambda-framework-gcloud";
import { DustTemplateRenderer } from "lambda-framework-dustjs";

const app: IApp = new App();
...
const cachedTime: number = 3000;
const templateRenderer: ITemplateRenderer = new DustTemplateRenderer(new CloudStorageTemplateLoader("PROJECT-ID", "bucket-name", cachedTime));
app.addTemplateEngine(templateRenderer);
...

Lambda Framework projects

Contributions

All contributors will be welcome. You can contributing by implementing/fixing/answering one open issue, by suggesting new features for the framework,... For more info about contributing, you can read the contributing file of the core project.

Make it happen.