On Tue, Sep 24, 2019 at 9:21 PM Ryan Davis <ryand-ruby / zenspider.com> wrote:

> > On Sep 24, 2019, at 13:47, Martin DeMello <martindemello / gmail.com>
> wrote:
> >
> > 2. Expose it at host:port (currently with puma, though I'm happy to
> change that if some other server makes it easier), and put it behind nginx
> with a prefix, e.g. myapp, so that the actual urls are /myapp/input and
> /myapp/process which rewrite to host:port/input and host:port/process
>
> POST often responds with a redirect. Let's say /myapp/new -> /myapp/form
> -> /myapp/list. Who should make sure that /myapp is on the redirect if the
> redirect is coming from your sinatra app? It sounds like maybe a raw rack
> layer underneath your app to just deal with adding/removing this prefix
> might be the right approach, but I'm not sure it's the best idea.
>
> What's your motivation for keeping the sinatra side ignorant of the prefix?
>

It just seems conceptually cleaner - the prefix isn't a detail of my app,
it's a detail of the way I'm hosting this particular instance of it (e.g.
if I put the app up on github, someone else might want to host it with an
entirely different prefix, or no prefix). Perhaps my best option is to have
sinatra be aware of the prefix but set it in a single place and use a
variable everywhere in the app.

martin
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>