I meet a problem when tracing the node.js express application. Following is the sample people often using:
app.get('/api/users', function(req, res) {
const user_id = req.query.id;
const token = req.query.token;
const geo = req.query.geo;
res.send({
'user_id': user_id,
'token': token,
'geo': geo
});
});
However, in the csurf case, the authentication function is this:
app.post('/process', parseForm, csrfProtection, function(req, res) {
res.send('data is being processed')
})
The problem is what the definition of express app function parameters like get or post, it seems very different from the usually usage scenario like the first case above, and the office document in express doesn't explain the four parameters situation. Any instruction is highly appreciated, thanks a lot.