Nodejs express path mapping problem

  node.js, question

/write? article=1

How do you map such paths in the nodejs express framework and how do you write regular ones?

There are two ways to write router:

1). /write? The corresponding acquisition statement for article=1 is
var article = req.query.article;

2) 2). /write/article/:id/:The corresponding acquisition statement for ID is
var article = req.params.id;

It is simple and convenient to choose one of the above two.