Discussion:
generate relative URLs with web-routes
Corentin Dupont
2015-12-09 22:11:57 UTC
Permalink
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
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/happs.
For more options, visit https://groups.google.com/d/optout.
Jeremy Shaw
2015-12-11 19:35:34 UTC
Permalink
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
Post by Corentin Dupont
Hi,
can I output relative URLs using web-routes?
showURL Main
This outputs an absolute URL in my HTML page: <a href=
http://example.com:8080/Main>
Post by Corentin Dupont
The problem is that it makes it difficult to put my application behind a
proxy/port forwarder such as NGinx.
Post by Corentin Dupont
Thanks,
Corentin
--
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
Visit this group at http://groups.google.com/group/happs.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/happs.
For more options, visit https://groups.google.com/d/optout.
Loading...