We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Either I'm missing something in the documentation (very likely), or middleware does not trigger for root paths. I've tried both GET and POST.
Example code
const lambdaApi = require('lambda-api'); const api = lambdaApi({ base: 'user', logger: true }); api.use((req, res, next) => { console.log('MIDDLEWARE START'); req.myVar = 'YES, HELLO'; next(); }); //static path api.get('/hello', async (req, res) => { console.log('/hello', req.myVar); res.json({hello: req.myVar}); }); //root path api.get('/', async (req, res) => { console.log('root', req.myVar); res.json({hello: req.myVar}); }); exports.handler = async (event, context) => { console.log('event:', JSON.stringify(event, undefined, 4)); console.log('context:', JSON.stringify(context, undefined, 4)); return await api.run(event, context); };
And logs
API Gateway has ANY method for base path /user
/user
Any pointers on what I'm doing wrong?
The text was updated successfully, but these errors were encountered:
basePath
naorpeled
Successfully merging a pull request may close this issue.
Either I'm missing something in the documentation (very likely), or middleware does not trigger for root paths. I've tried both GET and POST.
Example code
And logs
API Gateway has ANY method for base path
/user
Any pointers on what I'm doing wrong?
The text was updated successfully, but these errors were encountered: