Thanks, I'll check it out. Will get back to you in case of any queries.
Additionally, I would like like to know the performance of NJS as we will
be using this in production,
Which one has more performance - Lua or NJS ?
Please suggest here.
On Mon, Jun 3, 2019 at 11:33 PM Dmitry Volyntsev <xeioex@nginx.com> wrote:
>
>
> On 03.06.2019 20:43, naidile.pn wrote:
> >
> > I want to make a REST API call which is on a different server to fetch a
> > property.
> >
> > And add the property to the request from client and proxy it
>
>
> Currently you can do it using two sublocations with proxy_pass
> directives
> (http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass).
>
> --------------------
> function js_content(r) {
>
> r.subrequest("/property", reply => {
>
> if (reply.status != 200) { r.return(500, "prop failed"); return; }
>
> r.subrequest('/backend', res => {
> ...
> })
> })
> }
>
> ------------------
>
> We plan to add a Promise object this year, so in the future it will be
> less cumbersome.
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel