JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 94551
  • Score
    100M100P100Q162153F
  • License Apache-2.0

This library enables you to utilize Tencent Cloud API Gateway to respond to web and API requests using your existing Node.js application framework.

Package Exports

  • tencent-serverless-http

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 (tencent-serverless-http) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Tencent Serverless Nodejs

Build Status npm npm dependencies Status

This project is a fork of aws-serverless-express, and modify for tencent cloud scf.

Install

npm install tencent-serverless-nodejs

Usage

// handler.js
'use strict';
const tencentServerlessNodejs = require('tencent-serverless-nodejs');
const app = require('./app');
const server = tencentServerlessNodejs.createServer(app);

exports.handler = (event, context) => {
  tencentServerlessNodejs.proxy(server, event, context);
};

This package includes middleware to easily get the event object Lambda receives from API Gateway

const tencentServerlessNodejsMiddleware = require('tencent-serverless-nodejs/middleware');
app.use(tencentServerlessNodejsMiddleware.eventContext());
app.get('/', (req, res) => {
  res.json(req.apiGateway.event);
});