Open tcarac opened 2 years ago
You can use req.context
to retrieve the context object.
Hi @tcarac you can do this assigning the service you want directly to app during initialization.
example:
const api = require('lambda-api')()
api.services = {prisma}
api.post('/', async (req, res) => { const prisma = api.services.prisma; return prisma.posts.findMany({});}
Hey, im loving lambda-api so far. Quick question, is there a way to add a context to handlers ? Let's say
And this is basically for code splitting