perwendel / spark

A simple expressive web framework for java. Spark has a kotlin DSL https://github.com/perwendel/spark-kotlin
Apache License 2.0
9.63k stars 1.56k forks source link

Update RouteEntry to support single wildcard. #1092

Closed intUnderflow closed 5 years ago

intUnderflow commented 5 years ago

This updates RouteEntry so that if a path is a single wildcard (ie *) it will be accepted as matching any string. This makes it possible to create a catch-all spark route, for example via:

spark.get("*", ...)
perwendel commented 5 years ago

Thanks for commiting. I'll have a look at it, maybe next week. I find the functionality a bit strange but I might be wrong.

perwendel commented 5 years ago

You have this functionality by writing the code:

get("/*", (q, a) -> "Wild world!");