Nugine / s3s

S3 Service Adapter
Apache License 2.0
152 stars 37 forks source link

Multiple custom routes #220

Open St4NNi opened 6 days ago

St4NNi commented 6 days ago

https://github.com/Nugine/s3s/pull/209 has added the ability to add a custom route. Would it be possible to extend this to add more than one route? If so, I could give it a try!

Ok, looking at it more closely. We could have a generic /admin and handle all the subpaths ourselves.

BR

Nugine commented 6 days ago

You can use a router like matchit inside the custom route, which is the recommanded method. I'm also open to accept a PR that adds multiple custom routes if you like this way.

BTW, the Req/Resp types of custom route seem strange due to historical reasons. A (huge) breaking change is scheduled for these types (#210). It is not happening soon.

St4NNi commented 6 days ago

Thanks for the answer, I will try the matchit idea and if I miss something I will come back to the multiple routes option.