Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

tencent-serverless-http

1.2.0 • Public • Published

Tencent Serverless Http

Build Status npm NPM downloads

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

Install

npm install tencent-serverless-http

Usage

// handler.js
'use strict';
const tencentServerlessHttp = require('tencent-serverless-http');
const app = require('./app');
const server = tencentServerlessHttp.createServer(app);
 
exports.handler = (event, context) => {
  tencentServerlessHttp.proxy(server, event, context);
};

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

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

Install

npm i tencent-serverless-http

DownloadsWeekly Downloads

17

Version

1.2.0

License

Apache-2.0

Unpacked Size

17.1 kB

Total Files

9

Last publish

Collaborators

  • avatar