Re: [racket-users] Routing syntax

2016-04-05 Thread Brian Adkins
> On Apr 5, 2016, at 6:51 AM, antoine wrote: > > > I'm open to other ideas, but :variable is used in a number of routing > > string patterns in other languages/frameworks and seems fairly standard. > > My point was being standard with other racket work not other web framework. I'd like to sti

Re: [racket-users] Routing syntax

2016-04-05 Thread antoine
I'm open to other ideas, but :variable is used in a number of routing string patterns in other languages/frameworks and seems fairly standard. My point was being standard with other racket work not other web framework. I'm not sure I understand how*limiting* the constraint to be a regex is f

Re: [racket-users] Routing syntax

2016-04-04 Thread Brian Adkins
On Apr 4, 2016, at 8:15 PM, David Vanderson wrote: > > On 04/04/2016 02:08 PM, Brian Adkins wrote: >> (routes >> ("/" home-page) >> ("/:org_shortname/product_image/:style/:filename" product-image #:verbs >> (get) >>#:name prod-image #:when (regexp-match #rx".jpg$" filename)) >> ("/prod

Re: [racket-users] Routing syntax

2016-04-04 Thread David Vanderson
On 04/04/2016 02:08 PM, Brian Adkins wrote: (routes ("/" home-page) ("/:org_shortname/product_image/:style/:filename" product-image #:verbs (get) #:name prod-image #:when (regexp-match #rx".jpg$" filename)) ("/products/(*id).json" product-show #:verbs (get))) Any feedback is appre

Re: [racket-users] Routing syntax

2016-04-04 Thread Brian Adkins
> On Apr 4, 2016, at 3:44 PM, antoine wrote: > > Hello, > > I would go for 'methods instead of 'verbs, a HTTP vocabulary instead of a > REST one. Fair point. I suppose a couple additional characters won't kill me. > For the pathinfo: > > When using a string you use :pattern as place holder a

Re: [racket-users] Routing syntax

2016-04-04 Thread Brian Adkins
On Monday, April 4, 2016 at 3:39:13 PM UTC-4, Matt Jadud wrote: > Hi Brian, > > > This looks similar to what "dispatch" does? > > > https://docs.racket-lang.org/web-server/dispatch.html > > > > I've never extended the bi-directional patterns that are available, but there > is an extension m

Re: [racket-users] Routing syntax

2016-04-04 Thread antoine
Hello, I would go for 'methods instead of 'verbs, a HTTP vocabulary instead of a REST one. For the pathinfo: When using a string you use :pattern as place holder as far as i know there is no such convention in racket, maybe you should explore ~pattern (like format), #:pattern, 'pattern, #'p

Re: [racket-users] Routing syntax

2016-04-04 Thread Matt Jadud
Hi Brian, This looks similar to what "dispatch" does? https://docs.racket-lang.org/web-server/dispatch.html I've never extended the bi-directional patterns that are available, but there is an extension mechanism built in, so that your #:when notions might be part of an extended/new url component

[racket-users] Routing syntax

2016-04-04 Thread Brian Adkins
I've been looking into an appropriate syntax for routing web requests. For each route, I'll need the following information: * URL Pattern (required) e.g. "/" "/:org_shortname/product_image/:style/:filename" "/:org_shortname/products/(*id).json" * Function to handle request (required) * Ac