The problem with express API

suppose I have the following HTTP methods

router.post("/",(req,res,next)=>{}) 
router.get("/",(req,res,next)=>{})  order
router.get("/:orderId",(req,res,next)=>{})  order
router.patch("/:orderId",(req,res,next)=>{})   order
router.delete("/:orderId",(req,res,next)=>{})   order

if I want to get the number of all order now
should I send the request router.get ("/", (req,res,next) = > {}) to this router again,
still need to set up another get? How should I write it if necessary?
is this the case with router.get ("/ sumOfquantity", (req,res,next) = > {})?

suppose I only need one of the attributes of order as follows: single date
am I going to send a request router.get ("/", (req,res,next) = > {}) to this router again, and
then extract the attributes I want from the front end? do
still need to set up another get?
is router.get ("/: orderId/orderTime", (req,res,next) = > {})?

so far all I know is to simply add API to get deleted updates (that"s all). It would be best if you could give some other chestnuts with different operations. Or introduce some API design articles about different operations.

Thank you!

Feb.27,2021

1. To get the total is generally to add a new interface, otherwise you need to pass a lot of redundant data back and forth
2. You can use the original interface only by getting a property, which is not very frequent, and as long as the interface does not involve permission control, there is no need to add another interface

Menu