ohler55 / agoo-c

Agoo webserver in C.
MIT License
146 stars 16 forks source link

Route pattern support #2

Closed hieunc229 closed 5 years ago

hieunc229 commented 5 years ago

Hi Peter, I've been playing with agoo-c and think it's great. Since it didn't work when I try using regex pattern, how can I define dynamic routes? For example: /$project/users/$username, where it can get $project and $username.

Thank you

ohler55 commented 5 years ago

Take a look at https://www.rubydoc.info/gems/agoo/2.8.3/Agoo/Server, the handle method. It supports a glob pattern matching. "The path pattern follows glob like rules in that a single * matches a single token bounded by the / character and a double ** matches all remaining."

hieunc229 commented 5 years ago

Ah alright, thank you :)