Add constraint outside the constructor
matthyk opened this issue · 2 comments
matthyk commented
Currently, constraints can only be added when creating the FindMyWay instance. It would be very useful to be able to add more constraints later via a method like addConstraint
. With regard to Fastify, this would allow plugins to add constraints without the developer having to specify the constraint itself when creating the Fastify instance.
const router = require('find-my-way')()
router.addConstraint(...)
Is this even implementable and if so is it desirable to have such functionality?
ivan-tymoshenko commented
I don't see any problem with adding this. Sounds like a good idea.
matthyk commented
Nice! Then I'll try to implement it!