Koa-router route matching problem

koa-router routing settings are as follows,

router.get("/user/:id")
router.get("/user/aaa")

cannot access / user/aaa, is parsed to the parameter "aaa";
when the following settings are set,

router.get("/user/aaa")
router.get("/user/:id")

can access / user/aaa normally.
how can I tell whether it is a parameter or a path?

Mar.18,2021

who defines first and matches first.


/ user/:id id is the dynamic parameter
/ user/aaa is the definition of the path, but it will be matched to

by / user/:id first.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b33929-2abec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b33929-2abec.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?