generate relative URLs with web-routes

6 views
Skip to first unread message

Corentin Dupont

unread,
Dec 9, 2015, 5:11:58 PM12/9/15
to ha...@googlegroups.com, Jeremy Shaw
Hi,
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=http://example.com:8080/Main>
The problem is that it makes it difficult to put my application behind a proxy/port forwarder such as NGinx.

Thanks,
Corentin

Jeremy Shaw

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

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 happs+un...@googlegroups.com.
> To post to this group, send email to ha...@googlegroups.com.
> Visit this group at http://groups.google.com/group/happs.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages