generate relative URLs with web-routes

Skip to first unread message

Corentin Dupont

Dec 9, 2015, 5:11:58 PM12/9/15
to, Jeremy Shaw
can I output relative URLs using web-routes?
I'm using Web-Routes to generate URLs and embed them in HTML, like so:
showURL Main

This outputs an absolute URL in my HTML page: <a href=>
The problem is that it makes it difficult to put my application behind a proxy/port forwarder such as NGinx.


Jeremy Shaw

Dec 11, 2015, 2:35:36 PM12/11/15
to HAppS, Jeremy Shaw

I almost exclusively use web-routes behind a proxy, so I am not quite sure if I understand your issue.

web-routes generates relative urls which are appended to whatever baseURL you provide. For example if you have something like this:

   implSite (pack "http://localhost:8000") (pack "/route") site

The first argument is where the 'absolute uri' part is coming from. If you changed that to (pack "") then it would just spit out the relative URL.

Alternatively, you could provide the external address that users should be visiting rather than the internal name/port. 

Does that make sense?

- jeremy
> --
> You received this message because you are subscribed to the Google Groups "HAppS" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> To post to this group, send email to
> Visit this group at
> For more options, visit
Reply all
Reply to author
0 new messages