Support route regex
flyingsky opened this issue · comments
ramon commented
It seems now only supports fixed route, like "hello", how to support "hello*"?
The real problem is I want to support rest service like '/project/:id?' and '/media/:id?', or more types in future. I don't want to add same code in the router. Also in AWS API Gateway, it's not necessary to create multiple resources, I just have two, "/{model}" and "/{model}/{id}".
If API Gateway supports regex, I hope just one resource like "/{model}/{id}?".
ramon commented
I find a workaround. Actually I just api.get('/{model}',
function () {}), it still create path variable resource. And I can get
model` value from request.pathParams.model.