Closed openainext closed 4 years ago
const serverless = require('serverless-http'); const Koa = require('koa'); // or any supported framework
const app = new Koa();
app.use(function(ctx){
});
// this is it! module.exports.handler = serverless(app);
// or as a promise const handler = serverless(app); module.exports.handler = async (event, context) => { // you can do other things here
// and here return result; };
const serverless = require('serverless-http'); const Koa = require('koa'); // or any supported framework
const app = new Koa();
app.use(function(ctx){
//How ctx get context
});
// this is it! module.exports.handler = serverless(app);
// or as a promise const handler = serverless(app); module.exports.handler = async (event, context) => { // you can do other things here
const result = await handler(event, context); //context Where to go
// and here return result; };