[99s-extend] Generate url in cowboy

Antonio Valente antonio.valente at statpro.com
Tue Oct 22 10:51:14 CEST 2013


Hi all,
I need to automatically generate urls from the dispatcher configuration: 
I'm looking for some kind of function that, given the dispatcher 
configuration, a module and a list of bindings, returns an url.

For example, if I have the following dispatch configuration:

     [
     {'_', [

     {"/api/v1/container/:resource/something", a_module, []},
     ]}
     ].

I'd like to do something like:

<<"/api/v1/container/replaced/something">> = generate_url(Dispatch, 
a_module, [{resource, "replaced"}]).

Is there such a function? If not, can you give me some advice to write one?

Thanks
Antonio


This message is private and confidential. If you have received this message in error, please notify us and remove it from your system. Any views or opinions presented in this email are solely those of the author and might not represent those of StatPro. Warning: Although StatPro has taken reasonable precautions to ensure no viruses are present in this email, the company cannot accept responsibility for any loss or damage arising from the use of this email or attachments.



More information about the Extend mailing list