1.0.1 • Published 4 years ago

tencent-serverless-nodejs v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
4 years ago

Tencent Serverless Nodejs

Build Status npm npm dependencies Status

This project is a fork of tencent-serverless-nodejs, 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);
});
1.0.1

4 years ago

1.0.0

4 years ago