@tigojs/lambda-cors

0.1.2 • Public • Published

@tigojs/lambda-cors

Add cors support for tigo lambda.

This package is actually a wrapper of @koa/cors, see documentation of it to get more details of options.

Example

const cors = require('@tigojs/lambda-cors');

async function handleRequest(ctx) {
  // if you use an async function or the return of function is a promise, you should add an await before the cors(ctx);
  cors(ctx, corsOptions);
};

module.exports = handleRequest;

Readme

Keywords

none

Package Sidebar

Install

npm i @tigojs/lambda-cors

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

1.35 kB

Total Files

3

Last publish

Collaborators

  • backrunner