Reputation: 183
Basically, is it possible to write code like this with two middleware functions (authenticateToken and authenticateAdminKey) ?
app.post('/api', authenticateToken, authenticateAdminKey, function() {
...
}
I know something similar is possible when you're using multiple middleware for all the endpoints (as mentioned here). But I wanted to know if something like this is possible for just one endpoint?
Upvotes: 1
Views: 707
Reputation: 1448
middleware list pass in array
app.post('/api', [authenticateToken, authenticateAdminKey], function() {
...
}
Upvotes: 4