Open
Description
Currently, there is no app
object and the use
method is called directly:
const { use } = require('lambda-expressless');
const bodyParser = require('body-parser');
exports.handler = use(bodyParser.json(), (req, res) => {
res.status(201).json({
success: false,
data: req.body.id
})
});
Proposal: Add a workflow using the app
object, compatible with Express way of handling middleware and routing:
const Expressless = require('lambda-expressless');
const bodyParser = require('body-parser');
const app = Expressless()
app.use(bodyParser.json())
app.use('/do-it', authenticate, doIt)
app.use('/do-other-stuff', authenticate, doOtherStuff)
app.use(handleErrors)
exports.handler = app.apiGatewayHandler
Metadata
Metadata
Assignees
Labels
No labels